For work with site templates in the file includes/template.php is defined class
Template. The module object of this class is available through a variable
$this->diafan->_tpl
. In the module template class is accessible via
variable $this
.
string get (string $name, string $module, mixed $result, [string $template = '']) – Подключает шаблон.
Example:
// connect template of ads block if there is template
// modules/ab/views/ab.view.show_block_$attributes["template"].php
// otherwise connect the template modules/ab/views/ab.view.show_block.php
echo $this->diafan->_tpl->get('show_block', 'ab', $result, $attributes["template"]);
void js ([string $name = ''], [string $module = '']) – Подключает JS-файл.
Example:
// includes/controller.php
// connect JS-files common to the entire module
$this->diafan->_tpl->js();
void css ([string $name = ''], [string $module = '']) – Подключает CSS-файл.
string htmleditor (string $text) – Заменяет шаблонные теги, ссылки в тексте.
Example:
// output dynamic block by template tag
// in the file modules/news/views/news.view.id.php
echo $this->htmleditor('<insert name="show_dynamic" module="site" id="1">');
// treat news text, editable through a WYSIWYG editor
// in the file modules/news/news.model.php
$row["text"] = $this->diafan->_tpl->htmleditor($row["text"]);
Methods with the same name as their class will not be constructors in a future version of PHP; Markdown_Parser has a deprecated constructor #1 include_once() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499] #2 Docs_model->prepare_text( For work with site templates in the file *includes/template.php* is defined class *Template*. The module object of this class is available through a variable `$this->diafan->_tpl`. In the modul...) called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:94] #3 Docs_model->show() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.php:29] #4 Docs->init() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:474] #5 Init->module() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:119] #6 Init->start() called at [/var/www/diafan/data/www/diafancms.com/index.php:62] | /var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499 |