當前位置: 首頁>>代碼示例>>PHP>>正文


PHP server_component_tag::pre_generate方法代碼示例

本文整理匯總了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();');
	} 
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:13,代碼來源:outputcache.tag.php

示例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());');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:7,代碼來源:total.tag.php

示例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()){');
  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:14,代碼來源:dataspace.tag.php

示例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()){');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:15,代碼來源:list.tag.php

示例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('>');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:21,代碼來源:server_tag_component_tag.class.php

示例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('}');
     }
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:17,代碼來源:last.tag.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()) {');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:17,代碼來源:errors.tag.php

示例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()) {');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:14,代碼來源:actions.tag.php

示例9:

 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $code->write_php($this->get_component_ref_code() . '->prepare();');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:5,代碼來源:poll.tag.php

示例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");
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:6,代碼來源:order.tag.php

示例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()) {');
	} 
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:11,代碼來源:block.tag.php

示例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()){');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:12,代碼來源:list.tag.php


注:本文中的server_component_tag::pre_generate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。