本文整理汇总了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()) {');
}
示例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)) {');
}
示例3:
function pre_generate(&$code)
{
if (!isset($this->attributes['type'])) {
$this->attributes['type'] = 'string';
}
parent::pre_generate($code);
}
示例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)) {");
}
示例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 . ')) {');
}
示例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 . ')) {');
}
示例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);
}
}
示例8:
function pre_generate(&$code)
{
$id = $this->attributes['tab_id'];
$code->write_html("<div id='{$id}_content'>");
parent :: pre_generate($code);
}
示例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);
}
}
示例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);
}
}
示例11:
function pre_generate(&$code)
{
$code->write_html("
<table>
<tr>
<td height=100% valign=top>
");
parent :: pre_generate($code);
}
示例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);
}
示例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);
}
示例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 . ') {');
}
示例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 . ') {');
}