| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace ThurData\Servers\KerioEmail\Core\Traits;
- use ThurData\Servers\KerioEmail\Core\ServiceLocator;
- trait Smarty
- {
- /**
- * @var null|\ThurData\Servers\KerioEmail\Core\Http\View\Smarty
- */
- protected $smarty = null;
- public function loadSmarty()
- {
- if ($this->smarty === null)
- {
- $this->smarty = ServiceLocator::call('smarty');
- if (property_exists($this, 'lang') && method_exists($this, 'loadLang'))
- {
- $this->loadLang();
- $this->smarty->setLang($this->lang);
- }
- else
- {
- $lang = ServiceLocator::call('lang');
- $this->smarty->setLang($lang);
- }
- }
- }
- public function getSmarty()
- {
- if ($this->smarty === null)
- {
- $this->loadSmarty();
- }
- return $this->smarty;
- }
- }
|