You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

smarty_internal_method_createdata.php 1.3KB

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