Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

smarty_internal_compile_private_object_block_function.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Smarty Internal Plugin Compile Object Block Function
  4. * Compiles code for registered objects as block function
  5. *
  6. * @package Smarty
  7. * @subpackage Compiler
  8. * @author Uwe Tews
  9. */
  10. /**
  11. * Smarty Internal Plugin Compile Object Block Function Class
  12. *
  13. * @package Smarty
  14. * @subpackage Compiler
  15. */
  16. class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_Compile_Private_Block_Plugin
  17. {
  18. /**
  19. * Setup callback and parameter array
  20. *
  21. * @param \Smarty_Internal_TemplateCompilerBase $compiler
  22. * @param array $_attr attributes
  23. * @param string $tag
  24. * @param string $method
  25. *
  26. * @return array
  27. */
  28. public function setup(Smarty_Internal_TemplateCompilerBase $compiler, $_attr, $tag, $method)
  29. {
  30. $_paramsArray = array();
  31. foreach ($_attr as $_key => $_value) {
  32. if (is_int($_key)) {
  33. $_paramsArray[] = "$_key=>$_value";
  34. } else {
  35. $_paramsArray[] = "'$_key'=>$_value";
  36. }
  37. }
  38. $callback = array("\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]", "->{$method}");
  39. return array($callback, $_paramsArray, "array(\$_block_plugin{$this->nesting}, '{$method}')");
  40. }
  41. }