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


PHP compiler_directive_tag類代碼示例

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


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

示例1: get

 function generate_contents(&$code)
 {
     $file = 'common';
     if (isset($this->attributes['file'])) {
         $file = $this->attributes['file'];
     }
     if (isset($this->attributes['locale_type'])) {
         if (strtolower($this->attributes['locale_type']) == 'content') {
             $locale_constant = 'CONTENT_LOCALE_ID';
         } else {
             $locale_constant = 'MANAGEMENT_LOCALE_ID';
         }
     } else {
         $locale_constant = 'MANAGEMENT_LOCALE_ID';
     }
     if (isset($this->attributes['hash_id'])) {
         $locale_tmp = '$' . $code->get_temp_variable();
         $code->write_php("{$locale_tmp} = " . $this->get_dataspace_ref_code() . '->get("' . $this->attributes['hash_id'] . '");');
         if (defined('DEBUG_TEMPLATE_I18N_ENABLED') && constant('DEBUG_TEMPLATE_I18N_ENABLED')) {
             $code->write_php("\n          echo '<img src=\\'/shared/images/i.gif\\' title=\\'&#039;{$locale_tmp}&#039; from &#039;{$file}_???&#039; i18n file\\'>';");
         }
         $code->write_php("echo strings :: get({$locale_tmp}, '{$file}', constant('{$locale_constant}'));");
     } elseif (isset($this->attributes['name'])) {
         if (defined('DEBUG_TEMPLATE_I18N_ENABLED') && constant('DEBUG_TEMPLATE_I18N_ENABLED')) {
             $code->write_php("\n          echo '<img src=\\'/shared/images/i.gif\\' title=\\'&#039;{$this->attributes['name']}&#039; from &#039;{$file}_???&#039; i18n file\\'>';");
         }
         $code->write_php("echo strings :: get('{$this->attributes['name']}', '{$file}', constant('{$locale_constant}'));");
     }
     parent::generate_contents($code);
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:30,代碼來源:string.tag.php

示例2: foreach

  function post_generate(&$code)
  {
    if(!count($this->actions))
      parent :: post_generate($code);

    $code->write_html("<script>arr_actions['{$this->grid_list_id}'] = {");

    foreach($this->actions as $action_name => $action)
    {
      $action_path = $this->get_action_path($action);
      $code->write_html("'{$action_name}':{'href':'{$action_path}', 'name': '");

      if(isset($action['locale_value']))
      {
        $locale_file = '';
        if(isset($action['locale_file']))
          $locale_file = "','{$action['locale_file']}";
        $code->write_php("echo strings :: get('" . $action['locale_value'] . $locale_file ."')");
      }
      else
        $code->write_html($action['name']);

      $code->write_html("'},");
    }
    $code->write_html("'_' : {}}</script>");

    $code->write_html("<span id='{$this->grid_list_id}' behavior='CDDGridAction' ddalign='vbr'><img alt='' src='/shared/images/marker/1.gif'> ");
    $code->write_php("echo strings :: get('actions_for_selected');");
    $code->write_html("</span>");
    parent :: post_generate($code);
  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:31,代碼來源:actions.tag.php

示例3:

 function post_generate(&$code)
 {
     if ($this->is_debug_enabled()) {
         $code->write_html('</div>');
     }
     parent::post_generate($code);
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:7,代碼來源:root_compiler_component.class.php

示例4: uniqid

 function post_generate(&$code)
 {
     if (!count($this->actions)) {
         parent::post_generate($code);
     }
     $selector_id = uniqid('');
     $code->write_html("\n    <select id='{$selector_id}'>\n        <option value=''>");
     $code->write_php("echo strings :: get('choose_any')");
     $code->write_html("</option>");
     foreach ($this->actions as $option) {
         $action_path = $this->get_action_path($option);
         $code->write_html("<option value='{$action_path}'>");
         if (isset($option['locale_value'])) {
             $locale_file = '';
             if (isset($option['locale_file'])) {
                 $locale_file = "','{$option['locale_file']}";
             }
             $code->write_php("echo strings :: get('" . $option['locale_value'] . $locale_file . "')");
         } else {
             $code->write_html($option['name']);
         }
         $code->write_html("</option>");
     }
     $code->write_html("</select>");
     $this->render_button($code, $selector_id);
     parent::post_generate($code);
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:27,代碼來源:actions.tag.php

示例5: trim

  function generate_contents(&$code)
  {
    $dataspace = $this->get_dataspace_ref_code();

    $counter = '$' . $code->get_temp_variable();
    $value = '$' . $code->get_temp_variable();

    if (isset($this->attributes['hash_id']))
    {
      $code->write_php($value . ' = trim(' . $this->get_dataspace_ref_code() . '->get(\'' . $this->attributes['hash_id'] . '\'));');
    }
    else
    {
      if(!isset($this->attributes['value']))
        $this->attributes['value'] = 1;

      $code->write_php($value . ' = ' . $this->attributes['value'] . ';');
    }

    $code->write_php('for(' . $counter . '=0;' . $counter . ' < ' . $value . '; ' . $counter . '++){');

    parent :: generate_contents($code);

    $code->write_php('}');

  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:26,代碼來源:repeat.tag.php

示例6:

 function generate_contents(&$code)
 {
     $groups = $this->attributes['groups'];
     $code->write_php("if (user :: is_logged_in() && (user :: is_in_groups('{$groups}'))) {");
     parent::generate_contents($code);
     $code->write_php("}");
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:7,代碼來源:in_groups.tag.php

示例7: instance

 function generate_contents(&$code)
 {
     $user = '$' . $code->get_temp_variable();
     $code->write_php("{$user} =& user :: instance();");
     $code->write_php("if (!{$user}->is_logged_in()) {");
     parent::generate_contents($code);
     $code->write_php("}");
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:8,代碼來源:not_logged_in.tag.php

示例8:

	function generate_contents(&$code)
	{
		$code->write_php('
		require_once(LIMB_DIR . "/core/model/chat/chat_user.class.php");
		if (!chat_user :: is_logged_in()) {');
			parent :: generate_contents($code);
		$code->write_php("}");
	}
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:8,代碼來源:not_logged_in.tag.php

示例9: while

  /**
  *
  * @param code $ _writer
  * @return void
  * @access protected
  */
  function generate_contents(&$code)
  {
    $code->write_php('do { ');

    parent::generate_contents($code);

    $code->write_php('} while (' . $this->get_dataspace_ref_code() . '->next());');
  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:14,代碼來源:action.tag.php

示例10:

 function generate_contents(&$code)
 {
     $user_methods = get_class_methods('user');
     if (in_array('get_' . $this->attributes['name'], $user_methods)) {
         $code->write_php("echo user :: get_{$this->attributes['name']}();");
     }
     parent::generate_contents($code);
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:8,代碼來源:attribute.tag.php

示例11: instance

 function generate_contents(&$code)
 {
     $groups = $this->attributes['groups'];
     $user = '$' . $code->get_temp_variable();
     $code->write_php("{$user} =& user :: instance();");
     $code->write_php("if ({$user}->is_logged_in() && ({$user}->is_in_groups('{$groups}'))) {");
     parent::generate_contents($code);
     $code->write_php("}");
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:9,代碼來源:in_groups.tag.php

示例12:

 function generate_contents(&$code)
 {
     $temp = '$' . $code->get_temp_variable();
     $code->write_php('ob_start();');
     parent::generate_contents($code);
     $code->write_php($temp . ' = ob_get_contents();');
     $code->write_php('ob_end_clean();');
     $code->write_php($this->parent->get_component_ref_code() . '->set_left_mark("' . $temp . '");');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:9,代碼來源:left_mark.tag.php

示例13:

 function generate_contents(&$code)
 {
     $mapped = '$' . $code->get_temp_variable();
     $code->write_php("{$mapped} = fetch_mapped_by_url();");
     $code->write_php("if(isset({$mapped}['actions']) && array_key_exists('print_version', {$mapped}['actions'])){");
     $code->write_php($this->get_dataspace_ref_code() . "->set('link', {$mapped}['path'] . '?action=print_version');");
     parent::generate_contents($code);
     $code->write_php('}');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:9,代碼來源:link.tag.php

示例14:

  function post_generate(&$code)
  {
    $code->write_html("</a></td>
          </tr>
          </table>
        </td>
    ");

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

示例15:

 function generate_contents(&$code)
 {
     if ($this->is_debug_enabled()) {
         $code->write_html("<div style='border:dashed 1px red;'><img src='/shared/images/i.gif' alt='{$this->resolved_source_file}'><br>");
     }
     parent::generate_contents($code);
     if ($this->is_debug_enabled()) {
         $code->write_html('</div>');
     }
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:10,代碼來源:include.tag.php


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