2009-03-22 16:09:05 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2010-08-17 15:39:51 +00:00
|
|
|
* Smarty Internal Plugin Compile Object Block Function
|
|
|
|
* Compiles code for registered objects as block function
|
2011-09-16 14:19:56 +00:00
|
|
|
*
|
2014-06-06 02:40:04 +00:00
|
|
|
* @package Smarty
|
2010-08-17 15:39:51 +00:00
|
|
|
* @subpackage Compiler
|
2014-06-06 02:40:04 +00:00
|
|
|
* @author Uwe Tews
|
2010-08-17 15:39:51 +00:00
|
|
|
*/
|
|
|
|
|
2009-03-22 16:09:05 +00:00
|
|
|
/**
|
2010-08-17 15:39:51 +00:00
|
|
|
* Smarty Internal Plugin Compile Object Block Function Class
|
2011-09-16 14:19:56 +00:00
|
|
|
*
|
2014-06-06 02:40:04 +00:00
|
|
|
* @package Smarty
|
2011-09-16 14:19:56 +00:00
|
|
|
* @subpackage Compiler
|
2010-08-17 15:39:51 +00:00
|
|
|
*/
|
2016-01-02 11:27:44 +01:00
|
|
|
class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_Compile_Private_Block_Plugin
|
2013-07-14 22:15:45 +00:00
|
|
|
{
|
2011-09-16 14:19:56 +00:00
|
|
|
/**
|
2016-01-02 11:27:44 +01:00
|
|
|
* Setup callback and parameter array
|
2011-09-16 14:19:56 +00:00
|
|
|
*
|
2016-01-02 11:27:44 +01:00
|
|
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
2018-08-31 16:45:09 +02:00
|
|
|
* @param array $_attr attributes
|
2018-06-12 09:58:15 +02:00
|
|
|
* @param string $tag
|
|
|
|
* @param string $method
|
2011-09-16 14:19:56 +00:00
|
|
|
*
|
2016-01-02 11:27:44 +01:00
|
|
|
* @return array
|
2010-08-17 15:39:51 +00:00
|
|
|
*/
|
2016-01-02 11:27:44 +01:00
|
|
|
public function setup(Smarty_Internal_TemplateCompilerBase $compiler, $_attr, $tag, $method)
|
2009-03-22 16:09:05 +00:00
|
|
|
{
|
2016-01-02 11:27:44 +01:00
|
|
|
$_paramsArray = array();
|
|
|
|
foreach ($_attr as $_key => $_value) {
|
|
|
|
if (is_int($_key)) {
|
|
|
|
$_paramsArray[] = "$_key=>$_value";
|
2010-11-20 00:00:24 +00:00
|
|
|
} else {
|
2016-01-02 11:27:44 +01:00
|
|
|
$_paramsArray[] = "'$_key'=>$_value";
|
2010-11-20 00:00:24 +00:00
|
|
|
}
|
2011-09-16 14:19:56 +00:00
|
|
|
}
|
2016-01-02 17:58:58 +01:00
|
|
|
$callback = array("\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]", "->{$method}");
|
|
|
|
return array($callback, $_paramsArray, "array(\$_block_plugin{$this->nesting}, '{$method}')");
|
2011-09-16 14:19:56 +00:00
|
|
|
}
|
|
|
|
}
|