Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
2809 rexy 1
<?php
2
 
3
/**
4
 * Smarty Method CreateData
5
 *
6
 * Smarty::createData() method
7
 *
8
 * @package    Smarty
9
 * @subpackage PluginsInternal
10
 * @author     Uwe Tews
11
 */
12
class Smarty_Internal_Method_CreateData
13
{
14
    /**
15
     * Valid for Smarty and template object
16
     *
17
     * @var int
18
     */
19
    public $objMap = 3;
20
 
21
    /**
22
     * creates a data object
23
     *
24
     * @api  Smarty::createData()
25
     * @link http://www.smarty.net/docs/en/api.create.data.tpl
26
     *
27
     * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty      $obj
28
     * @param \Smarty_Internal_Template|\Smarty_Internal_Data|\Smarty_Data|\Smarty $parent next higher level of Smarty
29
     *                                                                                     variables
30
     * @param string                                                               $name   optional data block name
31
     *
32
     * @return \Smarty_Data data object
33
     */
34
    public function createData(Smarty_Internal_TemplateBase $obj, Smarty_Internal_Data $parent = null, $name = null)
35
    {
36
        /* @var Smarty $smarty */
37
        $smarty = $obj->_getSmartyObj();
38
        $dataObj = new Smarty_Data($parent, $smarty, $name);
39
        if ($smarty->debugging) {
40
            Smarty_Internal_Debug::register_data($dataObj);
41
        }
42
        return $dataObj;
43
    }
44
}