当前位置: 首页>>代码示例>>PHP>>正文


PHP compiler_directive_tag::generate_contents方法代码示例

本文整理汇总了PHP中compiler_directive_tag::generate_contents方法的典型用法代码示例。如果您正苦于以下问题:PHP compiler_directive_tag::generate_contents方法的具体用法?PHP compiler_directive_tag::generate_contents怎么用?PHP compiler_directive_tag::generate_contents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在compiler_directive_tag的用法示例。


在下文中一共展示了compiler_directive_tag::generate_contents方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 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

示例2: 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

示例3: 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

示例4:

 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

示例5:

	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

示例6: 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

示例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)
 {
     $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

示例9:

 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

示例10: 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

示例11:

	function generate_contents(&$code)
	{
		$value = $this->_typecast_value();
		
		$code->write_php($this->parent->get_component_ref_code() 
			. '->set_parameter("' . $this->attributes['name'] . '", ' 
			. var_export($value, true) . ')');
		
		parent::generate_contents($code);
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:parameter.tag.php

示例12:

 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

示例13:

 function generate_contents(&$code)
 {
     $dataspace = $this->get_dataspace_ref_code();
     if (isset($this->attributes['hash_id']) && isset($this->attributes['child_id'])) {
         if ($child =& $this->find_child($this->attributes['child_id'])) {
             $code->write_php($child->get_component_ref_code() . '->register_dataset(new array_dataset(' . $dataspace . '->get("' . $this->attributes['hash_id'] . '")))');
         }
     }
     parent::generate_contents($code);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:dataset.tag.php

示例14: instance

 function generate_contents(&$code)
 {
     $user_methods = get_class_methods('user');
     $user = '$' . $code->get_temp_variable();
     if (in_array('get_' . $this->attributes['name'], $user_methods)) {
         $code->write_php("{$user} =& user :: instance();");
         $code->write_php("echo {$user}->get_{$this->attributes['name']}();");
     }
     parent::generate_contents($code);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:attribute.tag.php

示例15:

 function generate_contents(&$code)
 {
     if ($this->is_debug_enabled()) {
         $code->write_html("<div class='debug-tmpl-include'>");
         $this->_generate_debug_editor_link_html($code, $this->resolved_source_file);
     }
     parent::generate_contents($code);
     if ($this->is_debug_enabled()) {
         $code->write_html('</div>');
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:include.tag.php


注:本文中的compiler_directive_tag::generate_contents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。