本文整理汇总了PHP中Tags::set_trigger方法的典型用法代码示例。如果您正苦于以下问题:PHP Tags::set_trigger方法的具体用法?PHP Tags::set_trigger怎么用?PHP Tags::set_trigger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tags
的用法示例。
在下文中一共展示了Tags::set_trigger方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parser_callback
/**
* Callback from template parser
*
* @param array
* @return mixed
*/
public function parser_callback($data)
{
$this->_ci->load->library('plugins');
$return_data = $this->_ci->plugins->locate($data);
if (is_array($return_data) && $return_data)
{
if ( ! $this->_is_multi($return_data))
{
$return_data = $this->_make_multi($return_data);
}
$content = $data['content'];
$parsed_return = '';
$simpletags = new Tags;
$simpletags->set_trigger(config_item('tags_trigger').':');
foreach ($return_data as $result)
{
if ($data['skip_content'])
{
$simpletags->set_skip_content($data['skip_content']);
}
$parsed = $simpletags->parse($content, $result, array($this, 'parser_callback'));
$parsed_return .= $parsed['content'];
}
unset($simpletags);
$return_data = $parsed_return;
}
return $return_data ? $return_data : NULL;
}
示例2: parser_callback
/**
* Callback from template parser
*
* @param array
* @return mixed
*/
public function parser_callback($data)
{
$this->_ci->load->library('plugins');
$return_data = $this->_ci->plugins->locate($data);
if (is_array($return_data)) {
if (!$this->_is_multi($return_data)) {
$return_data = $this->_make_multi($return_data);
}
$content = $data['content'];
$parsed_return = '';
$simpletags = new Tags();
$simpletags->set_trigger('pyro:');
foreach ($return_data as $result) {
$parsed = $simpletags->parse($content, $result, array($this, 'parser_callback'));
$parsed_return .= $parsed['content'];
}
unset($simpletags);
$return_data = $parsed_return;
}
return $return_data;
}
示例3: _parse_data_double
/**
* Get the data pertaining to the given double tag. This will
* loop through arrays of given data
*
* Example Data:
* $data = array(
* 'books' => array(
* array(
* 'title' => 'PHP for Dummies',
* 'author' => 'John Doe'
* ),
* array(
* 'title' => 'CodeIgniter for Dummies',
* 'author' => 'Jane Doe'
* )
* )
* );
*
* Example Tags:
* {books}
* {title} by {author}<br />
* {/books}
*
* @access private
* @param array The double tag
* @param array The data to parse
* @return mixed Either the data for the tag or FALSE
*/
private function _parse_data_double($tag, $data)
{
$return_data = '';
$new_data = $data;
foreach ($tag['segments'] as $segment)
{
if ( ! is_array($new_data) OR ! isset($new_data[$segment]))
{
return FALSE;
}
$new_data = $new_data[$segment];
}
$temp = new Tags;
$temp->set_trigger($this->_trigger);
foreach ($new_data as $val)
{
if ( ! is_array($val))
{
$val = array($val);
}
// We add the array element to the full data array so that full data
// tags can work within double data tags
$val = $val + $data;
$return = $temp->parse($tag['content'], $val, $this->_current_callback);
$return_data .= $return['content'];
}
unset($temp);
return $return_data;
}