Kohana В модуле для подключения Smarty не найден плагин

mstdmstd

Новичок
Всем привет
В Kohana 3.3.0 делаю свой модуль для подключения Smarty.
Ранее у меня был отдельный обьект который лежал в classes, к нему было обращение:

PHP:
			$AppSmarty= new AppSmarty();
			$data = $AppSmarty->AddSystemParameters( $some_data , null, '', true);
			$AppSmarty->PrepareSmartyTemplate( $kohana_view_filename, $data, '', true, true, true);
			$AppSmarty->display($kohana_view_filename, $data);
И все работало нормально.

Переделываю в модуль :

В bootstrap.php прописал :
PHP:
	 'appsmarty' => MODPATH.'appsmarty',
В /modules/appsmarty/classes/Kohana/Appsmarty.php :

PHP:
<?php defined('SYSPATH') or die('No direct script access.'); // как обычно - защита от прямого доступа
      $app_config = Kohana::$config->load('app');
      if ( !defined("SMARTY_DIR" ) ) {
        define("SMARTY_DIR", $app_config['smarty_dir']);
      }
      echo '<pre> SMARTY_DIR ::'.print_r( SMARTY_DIR, true ).'</pre><br>';
      require_once(SMARTY_DIR . 'Smarty.class.php'); // Подключаю смарти и вывожу на экпан пути - все ok

class Kohana_Appsmarty  extends Smarty {
 
    public static function instance(array $config = array())
    {
      return new Appsmarty($config);
    }
 
    public function __construct(array $config = array())
    {
		parent::__construct();
    }    
    
	public function PrepareSmartyTemplate($template_name, $data, $is_backend, $show_header_template = false, $show_footer_template = false)
	{
		$this->template_dir = APPPATH . 'views';
		$this->compile_dir = APPPATH . 'cache/templates_c';
		$this->cache_dir = APPPATH . 'cache';
		$this->config_dir = APPPATH . 'classes/Smarty/libs';  // подключаю все пути и вывожу на экран - все ok
		echo '<pre> ++++ $this->template_dir ::'.print_r( $this->template_dir, true ).'</pre><br>';

		foreach ($data as $DataKey => $DataValue) {
			$this->assign($DataKey, $DataValue);  // Добавляю все переменные
		}

		$this->registerPlugin("function", "show_sorting_directory", "smShowSortingDirectory"); // Подключаю плагины
...
		echo '<pre> ++smShowSortingDirectory::</pre><br>';

Вызов модуля:
PHP:
			$data = Appsmarty::instance()->AddSystemParameters( $kohana_view_data , null, '', true);
			Appsmarty::instance()->PrepareSmartyTemplate( $kohana_view_filename, $data, '', true, true, true);
			Appsmarty::instance()->display($kohana_view_filename, $data);
И проблема как раз и начинается при первом вызове плагина show_sorting_directory я получаю ошибку :

PHP:
SmartyCompilerException [ 0 ]: Syntax Error in template &quot;/mnt/diskD_Work/wwwroot/kohana/backend/views/admin/cms_items_list.tpl&quot; on line 119 &quot;&lt;a href=&quot;{$base_url_admin}cmsitem/index?{$PageParametersWithoutSort}&amp;sort=alias&amp;sort_direction={show_sorting_directory fieldname=&quot;alias&quot; sort_direction=$sort_direction sort=$sort}&quot;&gt;Alias&amp;nbsp;{show_list_sorting_image fieldname=&quot;alias&quot; sort_direction=$sort_direction sort=$sort images_dir_full_url=$images_dir_full_url}&lt;/a&gt;&quot; unknown tag &quot;show_sorting_directory&quot; 	 		
APPPATH/classes/Smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php [ 667 ]
В темплейте :
PHP:
        <th>
          <a href="{$base_url_admin}cmsitem/index?{$PageParametersWithoutSort}&sort=alias&sort_direction={show_sorting_directory fieldname="alias" sort_direction=$sort_direction sort=$sort}">Alias&nbsp;{show_list_sorting_image fieldname="alias" sort_direction=$sort_direction sort=$sort images_dir_full_url=$images_dir_full_url}</a>
        </th>
Причем если закоментарить вызовы всех плагинов - то страница отображается нормально.
Плагины не найдены ? А как правильно?
 

mstdmstd

Новичок
Видимо я забыл написать что функция
PHP:
function smShowSortingDirectory($params, $smarty)
{ ...
}
Находится в этом же файле /modules/appsmarty/classes/Kohana/Appsmarty.php но вне класса Kohana_Appsmarty,.
 
Сверху