currency-switcher
4 weeks ago
multi-currency
4 weeks ago
setup
4 weeks ago
status
4 weeks ago
store-urls
4 weeks ago
class-wcml-currencies-dropdown-ui.php
5 years ago
class-wcml-custom-files-ui.php
4 weeks ago
class-wcml-languages-upgrade-notice.php
4 years ago
class-wcml-menus-wrap-base.php
4 weeks ago
class-wcml-menus-wrap.php
4 weeks ago
class-wcml-multilingual-ui.php
9 months ago
class-wcml-not-translatable-attributes.php
4 weeks ago
class-wcml-pointer-ui.php
1 year ago
class-wcml-removed-cart-items-ui.php
4 weeks ago
class-wcml-settings-ui.php
4 weeks ago
class-wcml-st-taxonomy-ui.php
11 months ago
class-wcml-sync-taxonomy.php
4 weeks ago
class-wcml-templates-factory.php
4 weeks ago
class-wcml-troubleshooting-ui.php
4 weeks ago
class-wcml-currencies-dropdown-ui.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | class WCML_Currencies_Dropdown_UI { |
| 4 | |
| 5 | private $template_loader; |
| 6 | private $template; |
| 7 | |
| 8 | public function __construct( WPML_Twig_Template_Loader $template_loader ) { |
| 9 | $this->template_loader = $template_loader; |
| 10 | } |
| 11 | |
| 12 | public function get( $active_currencies, $selected_currency ) { |
| 13 | $model = [ |
| 14 | 'active_currencies' => $active_currencies, |
| 15 | 'selected_currency' => $selected_currency, |
| 16 | ]; |
| 17 | |
| 18 | return $this->get_template()->show( $model, 'currencies-dropdown.twig' ); |
| 19 | } |
| 20 | |
| 21 | private function get_template() { |
| 22 | if ( null === $this->template ) { |
| 23 | $this->template = $this->template_loader->get_template(); |
| 24 | } |
| 25 | |
| 26 | return $this->template; |
| 27 | } |
| 28 | |
| 29 | } |
| 30 |