本文整理汇总了PHP中server_component_tag::generate_constructor方法的典型用法代码示例。如果您正苦于以下问题:PHP server_component_tag::generate_constructor方法的具体用法?PHP server_component_tag::generate_constructor怎么用?PHP server_component_tag::generate_constructor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server_component_tag
的用法示例。
在下文中一共展示了server_component_tag::generate_constructor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
*
* @param code_writer $
* @return void
* @access protected
*/
function generate_constructor(&$code)
{
parent::generate_constructor($code);
if (array_key_exists('hide', $this->attributes)) {
$code->write_php($this->get_component_ref_code() . '->visible = false;');
}
}
示例2: unset
/**
*
* @param code $ _writer
* @return void
* @access protected
*/
function generate_constructor(&$code)
{
parent::generate_constructor($code);
if (array_key_exists('items', $this->attributes)) {
$code->write_php($this->get_component_ref_code() . '->items = \'' . $this->attributes['items'] . '\';');
unset($this->attributes['items']);
}
if (array_key_exists('pages_per_section', $this->attributes)) {
$code->write_php($this->get_component_ref_code() . '->pages_per_section = \'' . $this->attributes['pages_per_section'] . '\';');
unset($this->attributes['pages_per_section']);
}
}
示例3:
function generate_constructor(&$code)
{
parent :: generate_constructor($code);
}
示例4:
/**
* Writes the compiled template constructor from the runtime component,
* assigning the attributes found at compile time to the runtime component
* via a serialized string
*
* @param code $ _writer
* @return void
* @access protected
*/
function generate_constructor(&$code)
{
parent::generate_constructor($code);
$code->write_php($this->get_component_ref_code() . '->attributes = ' . var_export($this->attributes, true) . ';');
}
示例5:
/**
* Writes the compiled template constructor from the runtime component,
* assigning the attributes found at compile time to the runtime component
* via a serialized string
*
* @param code $ _writer
* @return void
* @access protected
*/
function generate_constructor(&$code)
{
parent::generate_constructor($code);
$code->write_php($this->get_component_ref_code() . '->attributes = ' . var_export($this->attributes, true) . ';');
//$code->write_php($this->get_component_ref_code() . '->attributes = unserialize("' . addslashes(serialize($this->attributes)) . '");');
}