diff --git a/docs/ru/programmers/plugins.xml b/docs/ru/programmers/plugins.xml index c9a5adad..b9205a10 100644 --- a/docs/ru/programmers/plugins.xml +++ b/docs/ru/programmers/plugins.xml @@ -1,49 +1,50 @@ - Extending Smarty With Plugins + Плагины - расширение функционала Smarty - Version 2.0 introduced the plugin architecture that is used - for almost all the customizable functionality of Smarty. This includes: + Архитектура версии 2.0 позволяет внедрять плагины, которыми являются + практически все настраиваемые элементы функционала Smarty. Сюда входят: - functions - modifiers - block functions - compiler functions - prefilters - postfilters - outputfilters - resources - inserts + функции + модификаторы + блоковые функции + функции компилятора + префильтры + постфильтры + фильтры вывода + ресурсы + вставки - With the exception of resources, backwards compatibility with the old - way of registering handler functions via register_* API is preserved. If - you did not use the API but instead modified the class variables - $custom_funcs, $custom_mods, and - other ones directly, then you will need to adjust your scripts to either - use the API or convert your custom functionality into plugins. + За исключением ресурсов, в целях обратной совместимости с предыдущими версиями, сохранена + возможность регистрации функций посредством register_* API. + Если вы не используете API, а вместо этого модифицируете + $custom_funcs, $custom_mods и некоторые другие + переменные напрямую, тогда вам придется подогнать ваши скрипты под использование + API или преобразовать добавленную вами функциональность в плагины. - How Plugins Work + Как работают плагины - Plugins are always loaded on demand. Only the specific modifiers, - functions, resources, etc invoked in the templates scripts will be - loaded. Moreover, each plugin is loaded only once, even if you have - several different instances of Smarty running within the same request. + Плагины загружаются только при необходимости. Загруженными окажутся + только только те модификаторы, функции,ресурсы и т.п., которые + определены в скрипте шаблона. Более того, каждый плагин загружается + лишь один раз, даже если у вас имеется несколько различных экземпляров + объекта Smarty, выполняемых внутри одного запроса. - Pre/postfilters and output filters are a bit of a special case. Since - they are not mentioned in the templates, they must be registered or - loaded explicitly via API functions before the template is processed. - The order in which multiple filters of the same type are executed - depends on the order in which they are registered or loaded. + Пре/постфильтры и фильтры вывода - это отдельный случай. Так как + они не упоминаются в шаблонах, их необходимо зарегистрировать + или явно загрузить с помощью API-функций перед обработкой шаблона. + Порядок исполнения множественных фильтров зависит от порядка, в котором + они были зарегистрированы или загружены. - There is only one plugins directory (for performance reasons). To - install a plugin, simply place it in the directory and Smarty will use - it automatically. + В целях оптимизации производительности, под плагины отведена одна + специальная директория. Чтобы установить плагин, просто поместите его + в эту директорию и Smarty будет использовать его в автоматическом режиме. diff --git a/docs/ru/programmers/plugins/plugins-block-functions.xml b/docs/ru/programmers/plugins/plugins-block-functions.xml index 6ca6c5bf..32d4e11b 100644 --- a/docs/ru/programmers/plugins/plugins-block-functions.xml +++ b/docs/ru/programmers/plugins/plugins-block-functions.xml @@ -1,77 +1,83 @@ - + - Block Functions - - - void smarty_block_name - array $params - mixed $content - object &$smarty - - - - Block functions are functions of the form: {func} .. {/func}. In other - words, they enclose a template block and operate on the contents of - this block. Block functions take precedence over custom functions of - the same name, that is, you cannot have both custom function {func} and - block function {func} .. {/func}. - - - Your function implementation is called twice by Smarty: - once for the opening tag, and once for the closing tag. - - - Only the opening tag of the block function may have attributes. All - attributes passed to template functions from the template are contained - in the $params as an associative array. You can - either access those values directly, e.g. - $params['start'] or use - extract($params) to import them into the symbol - table. The opening tag attributes are also accessible to your function - when processing the closing tag. - - - The value of $content variable depends on - whether your function is called for the opening or closing tag. In case - of the opening tag, it will be null, and in case of - the closing tag it will be the contents of the template block. - Note that the template block will have already been processed by - Smarty, so all you will receive is the template output, not the - template source. - - - If you have nested block functions, it's possible to find out what the - parent block function is by accessing - $smarty->_tag_stack variable. Just do a var_dump() - on it and the structure should be apparent. - - - See also: - register_block(), - unregister_block(). - - - block function - -<?php + + + Блоковые функции + + + void smarty_block_name + array $params + mixed $content + object &$smarty + + + + Блоковые функции выглядят следующим образом: {func} .. {/func}. Другими словами, + они заключены в определенном блоке шаблона и оперируют содержимым этого блока. + Блоковые функции имеют приоритет перед пользовательскими функциями, имеющими то же имя, + поэтому, вы не сможете использовать одновременно свои функции вида {func} и + блоковые функции {func} .. {/func}. + + + Smarty вызывает ваши функции дважды: + первый раз при открытии тэга и второй раз при закрытии тэга. + + + Только открывающий тэг блоковой функции может иметь атрибуты. Все + атрибуты, переданные в функцию из шаблона сохраняются + в $params в виде ассоциативного массива. Вы можете + получить прямой доступ к их значениям: + $params['start'] или использовать + extract($params) для импорта. + Атрибуты, переданные в открывающем тэге доступны для вашей функции + до обработки закрывающего тэга включительно. + + + Значение переменной $content зависит от того, + вызывается ли ваша функция для отрывающего тэга или вызов происходит при закрытии тэга. + В случае с открывающим тэгом, это значение будет равно null, а в случае + закрывающего тэга, значение будет равно содержимому блока в шаблоне. + Заметьте, что этот блок шаблона уже будет обработан + Smarty и на выводе вы получите результат обработки, а не + исходный код шаблона. + + + Если вы используете вложенные блоковые функции, есть возможность определять родительские + блоковые функции. Достаточно получить значение переменной + $smarty->_tag_stack. Затем останется только применить var_dump() + для нее и структура будет видна. + + + Смотрите также: + register_block(), + unregister_block(). + + + Блоковая функция + + - +} +?> +]]> + + \ No newline at end of file +--> diff --git a/docs/ru/programmers/plugins/plugins-compiler-functions.xml b/docs/ru/programmers/plugins/plugins-compiler-functions.xml index 62c95feb..e06c6b9f 100644 --- a/docs/ru/programmers/plugins/plugins-compiler-functions.xml +++ b/docs/ru/programmers/plugins/plugins-compiler-functions.xml @@ -1,66 +1,75 @@ - + - Compiler Functions - - Compiler functions are called only during compilation of the template. - They are useful for injecting PHP code or time-sensitive static - content into the template. If there is both a compiler function and a - custom function registered under the same name, the compiler function - has precedence. - - - - mixed smarty_compiler_name - string $tag_arg - object &$smarty - - - - The compiler function is passed two parameters: the tag argument - string - basically, everything from the function name until the ending - delimiter, and the Smarty object. It's supposed to return the PHP code - to be injected into the compiled template. - - - See also - register_compiler_function(), - unregister_compiler_function(). - - - simple compiler function - + + + Функции компилятора + + Функции компилятора, как вы наверное догадались, вызываются + только в процессе компиляции шаблона. Они могут быть полезными + для вставки кода PHP или чувствительного ко времени статического + контента в шаблон. Если одновременно зарегестрированы две + одноименные функции - пользовательская и компилятора, то приоритет + будет у функции компилятора. + + + + mixed smarty_compiler_name + string $tag_arg + object &$smarty + + + + Функция компилятора имеет два параметра: строку аргументов тэга - + чаще всего это все, что следует от наименования функции до правого + ограничителя, и объект Smarty. Функция должна возвращать PHP-код + для вствки в скомпилированный шаблон. + + + Смотрите также + register_compiler_function(), + unregister_compiler_function(). + + + Простой пример функции компилятора + _current_file . " compiled at " . date('Y-m-d H:M'). "';"; } -?> +?> ]]> - - This function can be called from the template as: - - -{* this function gets executed at compile time only *} -{tplheader} - - The resulting PHP code in the compiled template would be something like this: - - -<php + + Эта функция может быть вызвана из шаблона следующим образом: + + + + + + Результирующий код PHP в скомпилированном шаблоне будет выглядеть примерно так: + + + - +?> +]]> + + \ No newline at end of file +--> diff --git a/docs/ru/programmers/plugins/plugins-functions.xml b/docs/ru/programmers/plugins/plugins-functions.xml index e9741499..9892cbd4 100644 --- a/docs/ru/programmers/plugins/plugins-functions.xml +++ b/docs/ru/programmers/plugins/plugins-functions.xml @@ -1,42 +1,44 @@ - + - Template Functions - - - void smarty_function_name - array $params - object &$smarty - - - - All attributes passed to template functions from the template are - contained in the $params as an associative - array. Either access those values directly, e.g. - $params['start'] or use - extract($params) to import them into the symbol - table. - - - The output (return value) of the function will be substituted in place of the - function tag in the template (fetch function, for - example). Alternatively, the function can simply perform some other - task without any output (assign function). - - - If the function needs to assign some variables to the template or use - some other Smarty-provided functionality, it can use the supplied - $smarty object to do so. - - - See also: - register_function(), - unregister_function(). - - - - function plugin with output - -<?php + + + Функции шаблона + + + void smarty_function_name + array $params + object &$smarty + + + + Все атрибуты, передаваемые в функции шаблона из самого шаблона, + хранятся в $params в виде ассоциативного массива. + Получить доступ к его значениям можно напрямую: + $params['start'] или используя + extract($params) для импорта в таблицу. + + + Вывод (возвращаемое значение) функции будет подставлен в место расположения + тега функции в шаблоне (функция fetch например). + В качестве альтернативы, функция может выполнять какие либо действия + без какого-либо вывода (assign функция). + + + Если функция должна присвоить(assign) значения некоторым переменным в шаблоне или + использовать иные возможности Smarty, то можно работать с объектом + $smarty как обычно. + + + См. также: + register_function(), + unregister_function(). + + + + Функция-плагин с выводом + + - - - - which can be used in the template as: - +?> +]]> + + + + + которая может быть использована в шаблоне следующим образом: + + + + + + + Функция-плагин без вывода -Question: Will we ever have time travel? -Answer: {eightball}. - - - function plugin without output - -<?php +assign($var, $value); } -?> - - +?> +]]> + + + \ No newline at end of file +--> diff --git a/docs/ru/programmers/plugins/plugins-inserts.xml b/docs/ru/programmers/plugins/plugins-inserts.xml index 4bd9d9a4..501fe9a7 100644 --- a/docs/ru/programmers/plugins/plugins-inserts.xml +++ b/docs/ru/programmers/plugins/plugins-inserts.xml @@ -1,41 +1,42 @@ - + - Inserts - - Insert plugins are used to implement functions that are invoked by - insert - tags in the template. - - - - string smarty_insert_name - array $params - object &$smarty - - - - The first parameter to the function is an associative array of - attributes passed to the insert. Either access those values directly, - e.g. $params['start'] or use - extract($params) to import them into the symbol - table. - - - The insert function is supposed to return the result which will be - substituted in place of the insert tag in the - template. - - - insert plugin - -<?php + + + Вставки + + Плагины вставок используются для исполнения функций, вызываемых тэгом + insert + в шаблоне. + + + + string smarty_insert_name + array $params + object &$smarty + + + + Первый параметр функции представляет собой ассоциативный массив атрибутов, + переданых для вставки. Доступ к этим значениям можно получить как напрямую: + т.е. $params['start'] так и используя + extract($params) для импорта. + + + Функция вставки возвращает результат, которым будет + заменен тэг insert в шаблоне. + + + Плагин вставки + + - +?> +]]> + + \ No newline at end of file +--> diff --git a/docs/ru/programmers/plugins/plugins-modifiers.xml b/docs/ru/programmers/plugins/plugins-modifiers.xml index 9064f7cc..24bf66a0 100644 --- a/docs/ru/programmers/plugins/plugins-modifiers.xml +++ b/docs/ru/programmers/plugins/plugins-modifiers.xml @@ -1,69 +1,73 @@ - + - Modifiers - - Modifiers are little functions that are applied to a variable in the - template before it is displayed or used in some other context. - Modifiers can be chained together. - - - - mixed smarty_modifier_name - mixed $value - [mixed $param1, ...] - - - - The first parameter to the modifier plugin is the value on which - the modifier is supposed to operate. The rest of the parameters can be - optional, depending on what kind of operation is supposed to be - performed. - - - The modifier has to return the result of its processing. - - - See also - register_modifier(), - unregister_modifier(). - - - simple modifier plugin - - This plugin basically aliases one of the built-in PHP functions. It - does not have any additional parameters. - - -<?php + + + Модификаторы + + Модификаторы - это маленькие функции, которые воздействуют на переменные в + шаблоне перед тем, как те будут выведены на экран или использованы в ином контексте. + Для каждой переменной шаблона, одновременно могут быть использованы несколько модификаторов. + + + + mixed smarty_modifier_name + mixed $value + [mixed $param1, ...] + + + + Первый параметр плагина-модификатора это значение в отношении которого + модификатор будет применен. Остальные параметры могут быть + произвольными, в зависимости от операций, которые они осуществляют. + + + Модификатор должен возвращать результат, полученный в процессе своего выполнения. + + + Смотрите также: + register_modifier(), + unregister_modifier(). + + + Простой плагин-модификатор + + Этот плагин в своей основе является аналогом одной из PHP-функций. Он + не имеет никаких дополнительных параметров. + + + - - - - more complex modifier plugin - -<?php +?> +]]> + + + + Более сложный модификатор + + - +?> +]]> + + \ No newline at end of file +--> diff --git a/docs/ru/programmers/plugins/plugins-naming-conventions.xml b/docs/ru/programmers/plugins/plugins-naming-conventions.xml index b7676736..1bf76bca 100644 --- a/docs/ru/programmers/plugins/plugins-naming-conventions.xml +++ b/docs/ru/programmers/plugins/plugins-naming-conventions.xml @@ -1,61 +1,61 @@ - + - - Naming Conventions - - Plugin files and functions must follow a very specific naming - convention in order to be located by Smarty. - - - The plugin files must be named as follows: -
- - - type.name.php - - -
-
- - Where type is one of these plugin types: - - function - modifier - block - compiler - prefilter - postfilter - outputfilter - resource - insert - - - - And name should be a valid identifier (letters, - numbers, and underscores only). - - - Some examples: function.html_select_date.php, - resource.db.php, - modifier.spacify.php. - - - The plugin functions inside the plugin files must be named as follows: -
- - smarty_type_name - -
-
- - The meanings of type and name are - the same as before. - - - Smarty will output appropriate error messages if the plugin file it - needs is not found, or if the file or the plugin function are named - improperly. - + + + Соглашение об именах + + При присвоении имен файлам и функциям плагинов, необходимо придерживаться определенных + правил, чтобы Smarty находил и мог использовать эти плагины. + + + Имена файлов плагинов должны формироваться по следующей схеме: +
+ + + type.name.php + + +
+
+ + Где type (тип) это один из следующих типов плагинов: + + function + modifier + block + compiler + prefilter + postfilter + outputfilter + resource + insert + + + + и name (имя) соответствует правилам наименования идентификаторов в PHP + (только буквы, цифры и знак подчеркивания). + + + Несколько примеров: function.html_select_date.php, + resource.db.php, + modifier.spacify.php. + + + Функции, находящиеся внутри файлов плагинов, должны именоваться следующим образом: +
+ + smarty_type_name + +
+
+ + Значения type и name те же, что прежде. + + + Smarty выдаст сообщение об ошибке, если необходимый файл плагина + не будет найден, или файл плагина, а так же функция плагина + будут названы неправильно. +
\ No newline at end of file +--> diff --git a/docs/ru/programmers/plugins/plugins-outputfilters.xml b/docs/ru/programmers/plugins/plugins-outputfilters.xml index 8b1cfdf6..8f929a79 100644 --- a/docs/ru/programmers/plugins/plugins-outputfilters.xml +++ b/docs/ru/programmers/plugins/plugins-outputfilters.xml @@ -1,36 +1,38 @@ - + - Output Filters - - Output filter plugins operate on a template's output, after the - template is loaded and executed, but before the output is displayed. - - - - string smarty_outputfilter_name - string $template_output - object &$smarty - - - - The first parameter to the output filter function is the template - output that needs to be processed, and the second parameter is the - instance of Smarty invoking the plugin. The plugin is supposed to do - the processing and return the results. - - - output filter plugin - + + + Фильтры вывода + + Плагины фильтров вывода оперирут выходным кодом шаблона после того, как + шаблон был загружен и обработан, но перед его выводом в браузер. + + + + string smarty_outputfilter_name + string $template_output + object &$smarty + + + + Первый параметр функции фильтра вывода - это выходной код шаблона + который должен быть обработан, а второй параметр - это + экземпляр объекта Smarty, вызвавший этот плагин. Плагин предназначен для обработки + и возврата результата. + + + Плагин фильтра вывода + ]]> - - + + \ No newline at end of file +--> diff --git a/docs/ru/programmers/plugins/plugins-prefilters-postfilters.xml b/docs/ru/programmers/plugins/plugins-prefilters-postfilters.xml index b0aca2b2..75799ecf 100644 --- a/docs/ru/programmers/plugins/plugins-prefilters-postfilters.xml +++ b/docs/ru/programmers/plugins/plugins-prefilters-postfilters.xml @@ -1,87 +1,88 @@ - + - - Prefilters/Postfilters - - Prefilter and postfilter plugins are very similar in concept; where - they differ is in the execution -- more precisely the time of their - execution. - - - - string smarty_prefilter_name - string $source - object &$smarty - - - - Prefilters are used to process the source of the template immediately - before compilation. The first parameter to the prefilter function is - the template source, possibly modified by some other prefilters. The - plugin is supposed to return the modified source. Note that this - source is not saved anywhere, it is only used for compilation. - - - - string smarty_postfilter_name - string $compiled - object &$smarty - - - - Postfilters are used to process the compiled output of the template - (the PHP code) immediately after the compilation is done but before the - compiled template is saved to the filesystem. The first parameter to - the postfilter function is the compiled template code, possibly - modified by other postfilters. The plugin is supposed to return the - modified version of this code. - - - prefilter plugin - + + + Префильтры/Постфильтры + + Концепция плагинов префильтров и постфильтров очень проста; они + отличаются местом исполнения, или, точнее, временем их исполнения. + + + + string smarty_prefilter_name + string $source + object &$smarty + + + + Префильтры используются для обработки исходного кода шаблона непосредственно + перед компиляцией. Первый параметр функции префильтра - это + исходный код шаблона, который, возможно, уже изменен другими префильтрами. + Такой плагин возвращает модифицированый исходный код. Заметьте, что + этот исходный код нигде не сохраняется, он используется только для компиляции. + + + + string smarty_postfilter_name + string $compiled + object &$smarty + + + + Постфильтры используются для обработки скомпилированного вывода шаблона + (по сути - PHP-кода) сразу по завершению компиляции, но перед сохранением + откомпилированного шаблона в файловой системе. Первым параметром + функции постфильтра является скомпилированный код шаблона, возможно + уже модифицированый другими постфильтрами. Плагин возвращает + модифицированную версию этого кода. + + + Плагин префильтра + ;]+>!e', 'strtolower("$1")', $source); } -?> + ?> ]]> - - - - postfilter plugin - + + + + Плагин постфильтра + \nget_template_vars()); ?>\n" . $compiled; return $compiled; } -?> +?> ]]> - + \ No newline at end of file +--> diff --git a/docs/ru/programmers/plugins/plugins-resources.xml b/docs/ru/programmers/plugins/plugins-resources.xml index cffbd72f..6fdb9054 100644 --- a/docs/ru/programmers/plugins/plugins-resources.xml +++ b/docs/ru/programmers/plugins/plugins-resources.xml @@ -1,99 +1,101 @@ - + - Resources - - Resource plugins are meant as a generic way of providing template - sources or PHP script components to Smarty. Some examples of resources: - databases, LDAP, shared memory, sockets, and so on. - + + + Ресурсы + + Плагины ресурсов описывают источники данных, из которых берется исходный + код шаблона или компоненты PHP-скрипта для Smarty. Вот примеры ресурсов: + базы данных, LDAP, разделяемая память (shared memory), сокеты, и прочее. + - - There are a total of 4 functions that need to be registered for each - type of resource. Every function will receive the requested resource as - the first parameter and the Smarty object as the last parameter. The - rest of parameters depend on the function. - + + Необходимо 4 функции для того, чтобы зарегестрировать + каждый тип ресурса. Каждая такая функция получает запрашиваемый ресурс в качестве + первого параметра и объект Smarty как последний параметр. + Остальные параметры зависят от функции. + - - - bool smarty_resource_name_source - string $rsrc_name - string &$source - object &$smarty - - - bool smarty_resource_name_timestamp - string $rsrc_name - int &$timestamp - object &$smarty - - - bool smarty_resource_name_secure - string $rsrc_name - object &$smarty - - - bool smarty_resource_name_trusted - string $rsrc_name - object &$smarty - - + + + bool smarty_resource_name_source + string $rsrc_name + string &$source + object &$smarty + + + bool smarty_resource_name_timestamp + string $rsrc_name + int &$timestamp + object &$smarty + + + bool smarty_resource_name_secure + string $rsrc_name + object &$smarty + + + bool smarty_resource_name_trusted + string $rsrc_name + object &$smarty + + - - The first function is supposed to retrieve the resource. Its second - parameter is a variable passed by reference where the result should be - stored. The function is supposed to return true if - it was able to successfully retrieve the resource and - false otherwise. - + + Первая функция получает ресурс. Ее первый + параметр, это переменная, переданная по ссылке. В нее будет сохранен результат. + Функция вернет true если + сможет удачно получить ресурс и + false в ином случае. + - - The second function is supposed to retrieve the last modification time - of the requested resource (as a UNIX timestamp). The second parameter - is a variable passed by reference where the timestamp should be stored. - The function is supposed to return true if the - timestamp could be succesfully determined, and false - otherwise. - + + Вторая функция получает время последней модификации + запрошенного ресурса (в виде UNIX timestamp). Второй параметр + представляет собой переменную, переданную по ссылке, в которой и будет сохранено время. + Функция вернет true если + timestamp будет определен в правильной форме, и false + в ином случае. + - - The third function is supposed to return true or - false, depending on whether the requested resource - is secure or not. This function is used only for template resources but - should still be defined. - + + Третья функция возвращает true или + false в зависимости от того, является ли + запрашиваемый ресурс безопасным. Эта функция используется только для ресурсов шаблона, но + в любом случае должна быть определена. + - - The fourth function is supposed to return true or - false, depending on whether the requested resource - is trusted or not. This function is used for only for PHP script - components requested by include_php tag or - insert tag with src - attribute. However, it should still be defined even for template - resources. - - - See also - register_resource(), - unregister_resource(). - - - resource plugin - -<?php + + Четвертая функция возвращает true или + false в зависимости от того, заслуживает ли запрашиваемый ресурс доверия + (is trusted) или нет. Эта функция используется только для компонентов PHP-скрипта, + запрошенных тэгом include_php или + insert с src + атрибутом. Тем не менее, она должна объявляться даже для ресурсов шаблона. + + + Смотрите также: + register_resource(), + unregister_resource(). + + + Плагин ресурса + +query("select tpl_source from my_table @@ -106,9 +108,9 @@ function smarty_resource_db_source($tpl_name, &$tpl_source, &$smarty) } } -function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smarty) +function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smarty) { - // do database call here to populate $tpl_timestamp. + // выполняем обращение к базе данных для присвоения значения $tpl_timestamp. $sql = new SQL; $sql->query("select tpl_timestamp from my_table @@ -121,18 +123,20 @@ function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smar } } -function smarty_resource_db_secure($tpl_name, &$smarty) +function smarty_resource_db_secure($tpl_name, &$smarty) { - // assume all templates are secure + // предполагаем, что шаблоны безопасны return true; } -function smarty_resource_db_trusted($tpl_name, &$smarty) +function smarty_resource_db_trusted($tpl_name, &$smarty) { - // not used for templates + // не используется для шаблонов } -?> - +?> +]]> + + \ No newline at end of file +--> diff --git a/docs/ru/programmers/plugins/plugins-writing.xml b/docs/ru/programmers/plugins/plugins-writing.xml index 773e5111..096c674e 100644 --- a/docs/ru/programmers/plugins/plugins-writing.xml +++ b/docs/ru/programmers/plugins/plugins-writing.xml @@ -1,28 +1,30 @@ - + - - Writing Plugins - - Plugins can be either loaded by Smarty automatically from the - filesystem or they can be registered at runtime via one of the - register_* API functions. They can also be unregistered by using - unregister_* API functions. - - - For the plugins that are registered at runtime, the name of the plugin - function(s) does not have to follow the naming convention. - - - If a plugin depends on some functionality provided by another plugin - (as is the case with some plugins bundled with Smarty), then the proper - way to load the needed plugin is this: - - -require_once SMARTY_DIR . 'plugins/function.html_options.php'; - - As a general rule, Smarty object is always passed to the plugins as the last - parameter (except for modifiers). - + + + Написание плагинов + + Smarty может подгружать плагины автоматически из + файловой системы или регистрировать их во время выполнения + (at runtime) посредством одной из register_* API функций. + Их также можно дерегистрировать, используя unregister_* API функции. + + + Плагинам, которые регистрируются во время выполнения, + могут присваиваться имена не соответствующие правилам соглашения об именах. + + + Если плагин зависит от некоторых функций другого плагина + (как в некоторых случаях с плагинами, поставляемыми вместе со Smarty), то + такой плагин можно загрузить следующим образом: + + + require_once SMARTY_DIR . 'plugins/function.html_options.php'; + + + Важно знать, что объект Smarty всегда посылается в плагин как последний + параметер (за исключением модификаторов). + \ No newline at end of file +-->