本文整理汇总了PHP中server_component_tag::pre_generate方法的典型用法代码示例。如果您正苦于以下问题:PHP server_component_tag::pre_generate方法的具体用法?PHP server_component_tag::pre_generate怎么用?PHP server_component_tag::pre_generate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server_component_tag
的用法示例。
在下文中一共展示了server_component_tag::pre_generate方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
*
* @param code $ _writer
* @return void
* @access protected
*/
function pre_generate(&$code)
{
$this->content_ref = get_new_server_id();
parent::pre_generate($code);
$code->write_php('if (!' . $this->get_component_ref_code() . '->is_cached()) {');
$code->write_php('ob_start();');
}
示例2:
function pre_generate(&$code)
{
$parent =& $this->find_parent_by_class('pager_navigator_tag');
parent::pre_generate($code);
$code->write_php($this->get_component_ref_code() . '->set("number", ' . $parent->get_component_ref_code() . '->get_total_items());');
$code->write_php($this->get_component_ref_code() . '->set("more_than_one_page", ' . $parent->get_component_ref_code() . '->has_more_than_one_page());');
}
示例3:
/**
*
* @param code $ _writer
* @return void
* @access protected
*/
function pre_generate(&$code)
{
$code->write_php($this->get_component_ref_code() . '->prepare();');
parent :: pre_generate($code);
$code->write_php('if (!' . $this->get_dataspace_ref_code() . '->is_empty()){');
}
示例4:
/**
*
* @param code $ _writer
* @return void
* @access protected
*/
function pre_generate(&$code)
{
$code->write_php($this->get_component_ref_code() . '->prepare();');
parent::pre_generate($code);
if ($this->has_form) {
$code->write_html('<form name="grid_form" id="grid_form_' . $this->get_server_id() . '" method="post">');
}
$code->write_php('if (' . $this->get_dataspace_ref_code() . '->get_total_row_count()){');
}
示例5:
/**
* Calls the parent pre_generate() method then writes the XML tag name
* plus a PHP string which renders the attributes from the runtime
* component.
*
* @param code $ _writer
* @return void
* @access protected
* @todo compiler needs to detect XML to allow for empty tags
*/
function pre_generate(&$code)
{
parent::pre_generate($code);
$code->write_html('<' . $this->get_rendered_tag());
$code->write_php($this->get_component_ref_code() . '->render_attributes();');
// if this is an XML based document and this component is self closing,
// (a condition we cannot yet detect.)
// $code->write_html('/');
$this->generate_extra_attributes($code);
$code->write_html('>');
}
示例6:
/**
*
* @param code $ _writer
* @return void
* @access protected
*/
function pre_generate(&$code)
{
$this->hide_for_current_page = array_key_exists('hide_for_current_page', $this->attributes);
$parent =& $this->find_parent_by_class('pager_navigator_tag');
$code->write_php('if (!' . $parent->get_component_ref_code() . '->is_last()) {');
parent::pre_generate($code);
$code->write_php($this->get_component_ref_code() . '->set("href", ' . $parent->get_component_ref_code() . '->get_last_page_uri());');
if (!$this->hide_for_current_page) {
$code->write_php('}');
}
}
示例7:
/**
*
* @param code $ _writer
* @return void
* @access protected
*/
function pre_generate(&$code)
{
parent::pre_generate($code);
$parent_form =& $this->find_parent_by_class('form_tag');
$code->write_php($this->get_component_ref_code() . '->register_dataset(' . $parent_form->get_component_ref_code() . '->get_error_dataset());');
if (isset($this->attributes['for'])) {
$code->write_php($this->get_dataspace_ref_code() . '->restrict_fields(array(\'' . $this->attributes['for'] . '\'));');
}
$code->write_php($this->get_component_ref_code() . '->prepare();');
$code->write_php('if (' . $this->get_dataspace_ref_code() . '->next()) {');
}
示例8:
function pre_generate(&$code)
{
parent::pre_generate($code);
$actions_array = '$' . $code->get_temp_variable();
$node_id = '$' . $code->get_temp_variable();
$node = '$' . $code->get_temp_variable();
$code->write_php("{$actions_array} = " . $this->parent->get_dataspace_ref_code() . '->get("actions");' . "\n");
$code->write_php("{$node_id} = " . $this->parent->get_dataspace_ref_code() . '->get("node_id");' . "\n");
$code->write_php("if(!{$node_id}){ \r\n\t\t\t{$node} =& map_url_to_node(); {$node_id} = {$node}['id'];}\n");
$code->write_php($this->get_component_ref_code() . "->set_actions({$actions_array});\n");
$code->write_php($this->get_component_ref_code() . "->set_node_id({$node_id});\n");
$code->write_php($this->get_component_ref_code() . '->prepare();' . "\n");
$code->write_php('if (' . $this->get_component_ref_code() . '->next()) {');
}
示例9:
function pre_generate(&$code)
{
parent::pre_generate($code);
$code->write_php($this->get_component_ref_code() . '->prepare();');
}
示例10:
function pre_generate(&$code)
{
parent::pre_generate($code);
$code->write_php($this->get_component_ref_code() . "->import(" . $this->parent->get_dataspace_ref_code() . "->export());\n");
$code->write_php($this->get_component_ref_code() . '->prepare();' . "\n");
}
示例11:
/**
*
* @param code_writer $
* @return void
* @access protected
*/
function pre_generate(&$code)
{
parent::pre_generate($code);
$code->write_php('if (' . $this->get_component_ref_code() . '->is_visible()) {');
}
示例12:
/**
*
* @param code $ _writer
* @return void
* @access protected
*/
function pre_generate(&$code)
{
$code->write_php($this->get_component_ref_code() . '->prepare();');
parent::pre_generate($code);
$code->write_php('if (' . $this->get_dataspace_ref_code() . '->get_total_row_count()){');
}