1: | <?php
2: | namespace Opencart\Catalog\Controller\Event;
3: | /**
4: | * Class Translation
5: | *
6: | * @package Opencart\Catalog\Controller\Event
7: | */
8: | class Translation extends \Opencart\System\Engine\Controller {
9: | /**
10: | * @param string $route
11: | * @param string $prefix
12: | *
13: | * @return void
14: | */
15: | public function index(string &$route, string &$prefix): void {
16: | $this->load->model('design/translation');
17: |
18: | $results = $this->model_design_translation->getTranslations($route);
19: |
20: | foreach ($results as $result) {
21: | if (!$prefix) {
22: | $this->language->set($result['key'], html_entity_decode($result['value'], ENT_QUOTES, 'UTF-8'));
23: | } else {
24: | $this->language->set($prefix . '_' . $result['key'], html_entity_decode($result['value'], ENT_QUOTES, 'UTF-8'));
25: | }
26: | }
27: | }
28: | }
29: |

OpenCart API API documentation generated by ApiGen dev-master