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


PHP compiler_directive_tag::pre_generate方法代碼示例

本文整理匯總了PHP中compiler_directive_tag::pre_generate方法的典型用法代碼示例。如果您正苦於以下問題:PHP compiler_directive_tag::pre_generate方法的具體用法?PHP compiler_directive_tag::pre_generate怎麽用?PHP compiler_directive_tag::pre_generate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在compiler_directive_tag的用法示例。


在下文中一共展示了compiler_directive_tag::pre_generate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

	/**
	* 
	* @param code $ _writer
	* @return void 
	* @access protected 
	*/
	function pre_generate(&$code)
	{
		parent::pre_generate($code);

		$parent = &$this->find_parent_by_class('pager_navigator_tag');
		$code->write_php('if (' . $parent->get_component_ref_code() . '->next()) {');
	} 
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:13,代碼來源:list.tag.php

示例2: trim

 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $counter = $code->get_temp_variable();
     $code->write_php('$' . $counter . ' = trim(' . $this->get_dataspace_ref_code() . '->get_counter());');
     $code->write_php('if (($' . $counter . ') && ($' . $counter . '%' . $this->count . ' == 0)) {');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:7,代碼來源:separator.tag.php

示例3:

 function pre_generate(&$code)
 {
     if (!isset($this->attributes['type'])) {
         $this->attributes['type'] = 'string';
     }
     parent::pre_generate($code);
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:7,代碼來源:parameter.tag.php

示例4: trim

 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $counter = '$' . $code->get_temp_variable();
     $code->write_php($counter . ' = trim(' . $this->get_dataspace_ref_code() . '->get_counter());');
     $code->write_php("if (\t({$counter} > 0) && \r\n\t\t\t\t\t\t\t({$counter} < " . $this->get_dataspace_ref_code() . "->get_total_row_count()) &&\r\n\t\t\t\t\t\t \t({$counter} % " . $this->count . " == 0)) {");
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:7,代碼來源:separator.tag.php

示例5: trim

 /**
  * 
  * @param code $ _writer
  * @return void 
  * @access protected 
  */
 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $tempvar = $code->get_temp_variable();
     $code->write_php('$' . $tempvar . ' = trim(' . $this->get_dataspace_ref_code() . '->get(\'' . $this->field . '\'));');
     $code->write_php('if (!empty($' . $tempvar . ')) {');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:13,代碼來源:optional.tag.php

示例6:

 /**
  *
  * @param code $ _writer
  * @return void
  * @access protected
  */
 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $tempvar = '$' . $code->get_temp_variable();
     $code->write_php($tempvar . ' = ' . $this->get_dataspace_ref_code() . '->get(\'' . $this->field . '\');');
     $code->write_php('if (!is_array(' . $tempvar . ' )) ' . $tempvar . ' = utf8_trim(' . $tempvar . ');');
     $code->write_php('if (empty(' . $tempvar . ')) {');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:14,代碼來源:default.tag.php

示例7: define

 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     if (!defined('HINT_SCRIPT_INCLUDED')) {
         $code->write_html("<script type='text/javascript' src='/shared/js/hint.js'></script>");
         define('HINT_SCRIPT_INCLUDED', true);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:8,代碼來源:hint.tag.php

示例8:

	function pre_generate(&$code)
	{
	  $id = $this->attributes['tab_id'];
	  
		$code->write_html("<div id='{$id}_content'>");
		
		parent :: pre_generate($code);
	}
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:8,代碼來源:tab_item_content.tag.php

示例9:

 /**
  * Calls the parent pre_generate() method then writes
  * "$dataspace->prepare();" to the compiled template.
  *
  * @param code $ _writer
  * @return void
  * @access protected
  */
 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $code->write_php($this->get_dataspace_ref_code() . '->prepare();');
     if ($this->is_debug_enabled()) {
         $code->write_html("<div class='debug-tmpl-main'>");
         $this->_generate_debug_editor_link_html($code, $this->source_file);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:17,代碼來源:root_compiler_component.class.php

示例10:

 /**
  * Calls the parent pre_generate() method then writes
  * "$dataspace->prepare();" to the compiled template.
  * 
  * @param code $ _writer
  * @return void 
  * @access protected 
  */
 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $code->write_php($this->get_dataspace_ref_code() . '->prepare();');
     if ($this->is_debug_enabled()) {
         $code->write_html("<div style='border:dashed 1px blue;padding: 10px 10px 10px 10px;'>");
         $this->_generate_debug_editor_link_html($code, $this->source_file);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:17,代碼來源:root_compiler_component.class.php

示例11:

	function pre_generate(&$code)
	{
    $code->write_html("
    	<table>
    	<tr>
    		<td height=100% valign=top>
		");
		
		parent :: pre_generate($code);
	}
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:10,代碼來源:tabs_contents.tag.php

示例12:

  function pre_generate(&$code)
  {
    $id = $this->attributes['tab_id'];

    $code->write_html("<td id={$id}>
          <table border='0' cellspacing='0' cellpadding='0' style='height:100%'>
          <tr>
            <td nowrap {$this->parent->parent->tab_class}><a href='JavaScript:void(0);'>");

    parent :: pre_generate($code);
  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:11,代碼來源:tab_item_label.tag.php

示例13: if

 function pre_generate(&$code)
 {
     $value = '$' . $code->get_temp_variable();
     $parent = $this->get_dataspace_ref_code();
     $radio_child =& $this->find_child_by_class('input_tag');
     $label_child =& $this->find_child_by_class('label_tag');
     $radio = $radio_child->get_component_ref_code();
     $label = $label_child->get_component_ref_code();
     $code->write_php("\r\n    if ({$value} = {$parent}->get('id'))\r\n    {\r\n      {$radio}->set_attribute('value', {$value});\r\n      {$radio}->set_attribute('id', {$value});\r\n      {$label}->set_attribute('for', {$value});\r\n    }\r\n    ");
     parent::pre_generate($code);
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:11,代碼來源:radio_selector.tag.php

示例14: trim

 /**
  * 
  * @param code $ _writer
  * @return void 
  * @access protected 
  */
 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $value = 'true';
     if (isset($this->attributes['value']) && !(bool) $this->attributes['value']) {
         $value = 'false';
     }
     $tempvar = $code->get_temp_variable();
     $code->write_php('$' . $tempvar . ' = trim(' . $this->get_dataspace_ref_code() . '->get("status"));');
     $code->write_php('if ((boolean)(constant("' . $this->const . '") & $' . $tempvar . ') === ' . $value . ') {');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:17,代碼來源:status.tag.php

示例15: isset

 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $value = 'true';
     if (isset($this->attributes['value']) && !(bool) $this->attributes['value']) {
         $value = 'false';
     }
     $tempvar = $code->get_temp_variable();
     $actions_tempvar = $code->get_temp_variable();
     $code->write_php('$' . $actions_tempvar . ' = ' . $this->get_dataspace_ref_code() . '->get("actions");');
     $code->write_php('if (isset($' . $actions_tempvar . '["publish"]) && isset($' . $actions_tempvar . '["unpublish"])) {');
     $code->write_php('$' . $tempvar . ' = trim(' . $this->get_dataspace_ref_code() . '->get("status"));');
     $code->write_php('if ((boolean)(constant("SITE_OBJECT_PUBLISHED_STATUS") & $' . $tempvar . ') === ' . $value . ') {');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:14,代碼來源:published.tag.php


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