| @@ 21-89 (lines=69) @@ | ||
| 18 | /** |
|
| 19 | * @author GeLo <[email protected]> |
|
| 20 | */ |
|
| 21 | class MapHelper extends Helper |
|
| 22 | { |
|
| 23 | /** |
|
| 24 | * @var BaseMapHelper |
|
| 25 | */ |
|
| 26 | private $mapHelper; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @param BaseMapHelper $mapHelper |
|
| 30 | */ |
|
| 31 | public function __construct(BaseMapHelper $mapHelper) |
|
| 32 | { |
|
| 33 | $this->mapHelper = $mapHelper; |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * @param Map $map |
|
| 38 | * @param string[] $attributes |
|
| 39 | * |
|
| 40 | * @return string |
|
| 41 | */ |
|
| 42 | public function render(Map $map, array $attributes = []) |
|
| 43 | { |
|
| 44 | $map->addHtmlAttributes($attributes); |
|
| 45 | ||
| 46 | return $this->mapHelper->render($map); |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * @param Map $map |
|
| 51 | * @param string[] $attributes |
|
| 52 | * |
|
| 53 | * @return string |
|
| 54 | */ |
|
| 55 | public function renderHtml(Map $map, array $attributes = []) |
|
| 56 | { |
|
| 57 | $map->addHtmlAttributes($attributes); |
|
| 58 | ||
| 59 | return $this->mapHelper->renderHtml($map); |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * @param Map $map |
|
| 64 | * |
|
| 65 | * @return string |
|
| 66 | */ |
|
| 67 | public function renderStylesheet(Map $map) |
|
| 68 | { |
|
| 69 | return $this->mapHelper->renderStylesheet($map); |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * @param Map $map |
|
| 74 | * |
|
| 75 | * @return string |
|
| 76 | */ |
|
| 77 | public function renderJavascript(Map $map) |
|
| 78 | { |
|
| 79 | return $this->mapHelper->renderJavascript($map); |
|
| 80 | } |
|
| 81 | ||
| 82 | /** |
|
| 83 | * {@inheritdoc} |
|
| 84 | */ |
|
| 85 | public function getName() |
|
| 86 | { |
|
| 87 | return 'ivory_google_map'; |
|
| 88 | } |
|
| 89 | } |
|
| 90 | ||
| @@ 21-79 (lines=59) @@ | ||
| 18 | /** |
|
| 19 | * @author GeLo <[email protected]> |
|
| 20 | */ |
|
| 21 | class PlaceAutocompleteHelper extends Helper |
|
| 22 | { |
|
| 23 | /** |
|
| 24 | * @var BasePlaceAutocompleteHelper |
|
| 25 | */ |
|
| 26 | private $placeAutocompleteHelper; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @param BasePlaceAutocompleteHelper $placeAutocompleteHelper |
|
| 30 | */ |
|
| 31 | public function __construct(BasePlaceAutocompleteHelper $placeAutocompleteHelper) |
|
| 32 | { |
|
| 33 | $this->placeAutocompleteHelper = $placeAutocompleteHelper; |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * @param Autocomplete $autocomplete |
|
| 38 | * @param string[] $attributes |
|
| 39 | * |
|
| 40 | * @return string |
|
| 41 | */ |
|
| 42 | public function render(Autocomplete $autocomplete, array $attributes = []) |
|
| 43 | { |
|
| 44 | $autocomplete->addInputAttributes($attributes); |
|
| 45 | ||
| 46 | return $this->placeAutocompleteHelper->render($autocomplete); |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * @param Autocomplete $autocomplete |
|
| 51 | * @param string[] $attributes |
|
| 52 | * |
|
| 53 | * @return string |
|
| 54 | */ |
|
| 55 | public function renderHtml(Autocomplete $autocomplete, array $attributes = []) |
|
| 56 | { |
|
| 57 | $autocomplete->addInputAttributes($attributes); |
|
| 58 | ||
| 59 | return $this->placeAutocompleteHelper->renderHtml($autocomplete); |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * @param Autocomplete $autocomplete |
|
| 64 | * |
|
| 65 | * @return string |
|
| 66 | */ |
|
| 67 | public function renderJavascript(Autocomplete $autocomplete) |
|
| 68 | { |
|
| 69 | return $this->placeAutocompleteHelper->renderJavascript($autocomplete); |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * {@inheritdoc} |
|
| 74 | */ |
|
| 75 | public function getName() |
|
| 76 | { |
|
| 77 | return 'ivory_google_place_autocomplete'; |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||