-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
10 - Add a form to add, edit or delete locations in the admin interface
- Loading branch information
1 parent
6706d26
commit ef30437
Showing
9 changed files
with
429 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" ?> | ||
<form xmlns="http://schemas.sulu.io/template/template" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/form-1.0.xsd" | ||
> | ||
<key>location_details</key> | ||
|
||
<properties> | ||
<property name="name" type="text_line" mandatory="true"> | ||
<meta> | ||
<title>sulu_admin.name</title> | ||
</meta> | ||
</property> | ||
|
||
<property name="street" type="text_line" colspan="9"> | ||
<meta> | ||
<title>sulu_contact.street</title> | ||
</meta> | ||
</property> | ||
|
||
<property name="number" type="text_line" colspan="3"> | ||
<meta> | ||
<title>sulu_contact.number</title> | ||
</meta> | ||
</property> | ||
|
||
<property name="postalCode" type="text_line" colspan="3"> | ||
<meta> | ||
<title>sulu_contact.zip</title> | ||
</meta> | ||
</property> | ||
|
||
<property name="city" type="text_line" colspan="6"> | ||
<meta> | ||
<title>sulu_contact.city</title> | ||
</meta> | ||
</property> | ||
|
||
<property name="countryCode" type="single_select" colspan="3"> | ||
<meta> | ||
<title>sulu_contact.country</title> | ||
</meta> | ||
|
||
<params> | ||
<param | ||
name="values" | ||
type="expression" | ||
value="service('app.country_select').getValues()" | ||
/> | ||
</params> | ||
</property> | ||
</properties> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Service; | ||
|
||
use Symfony\Component\Intl\Countries; | ||
|
||
class CountryCodeSelect | ||
{ | ||
/** | ||
* @return array[] | ||
*/ | ||
public function getValues(): array | ||
{ | ||
$values = []; | ||
|
||
foreach (Countries::getNames() as $code => $title) { | ||
$values[] = [ | ||
'name' => $code, | ||
'title' => $title, | ||
]; | ||
} | ||
|
||
return $values; | ||
} | ||
} |
Oops, something went wrong.