本文整理汇总了PHP中phpbb\template\template::get_source_file_for_handle方法的典型用法代码示例。如果您正苦于以下问题:PHP template::get_source_file_for_handle方法的具体用法?PHP template::get_source_file_for_handle怎么用?PHP template::get_source_file_for_handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpbb\template\template
的用法示例。
在下文中一共展示了template::get_source_file_for_handle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modify_case_img
/**
* Changes the regex replacement for second pass
*
* @param object $event
* @return null
* @access public
*/
public function modify_case_img($event)
{
$bbcode_id = 4;
// [img] has bbcode_id 4 hardcoded
$bbcode_cache = $event['bbcode_cache'];
if (!isset($bbcode_cache[$bbcode_id]) || !$this->user->optionget('viewimg')) {
return;
}
$this->template->set_filenames(array('bbcode.html' => 'bbcode.html'));
$bbcode = new \bbcode();
// We need these otherwise we cannot use $bbcode->bbcode_tpl()
$bbcode->template_bitfield = new \bitfield($this->user->style['bbcode_bitfield']);
$bbcode->template_filename = $this->template->get_source_file_for_handle('bbcode.html');
$extimgaslink_boardurl = generate_board_url() . '/';
$bbcode_cache[$bbcode_id] = array('preg' => array('#\\[img:$uid\\](' . preg_quote($extimgaslink_boardurl, '#') . '.*?)\\[/img:$uid\\]#s' => $bbcode->bbcode_tpl('img', $bbcode_id), '#\\[img:$uid\\](.*?)\\[/img:$uid\\]#s' => str_replace('$2', $this->user->lang('EXTIMGLINK'), $bbcode->bbcode_tpl('url', $bbcode_id, true))));
$event['bbcode_cache'] = $bbcode_cache;
}
示例2: bbcode_cache_init_end
/**
* Changes the regex replacement for second pass
*
* Based on phpBB.de - External Image as Link from Christian Schnegelberger<blackhawk87@phpbb.de> and Oliver Schramm <elsensee@phpbb.de>
*
* @param object $event
* @return null
* @access public
*/
public function bbcode_cache_init_end($event)
{
$bbcode_id = 4;
// [img] has bbcode_id 4 hardcoded
$bbcode_cache = $event['bbcode_cache'];
if (!isset($bbcode_cache[$bbcode_id]) || !$this->user->optionget('viewimg')) {
return;
}
$this->template->set_filenames(array('bbcode.html' => 'bbcode.html'));
$bbcode = new \bbcode();
// We need these otherwise we cannot use $bbcode->bbcode_tpl()
$bbcode->template_bitfield = new \bitfield($this->user->style['bbcode_bitfield']);
$bbcode->template_filename = $this->template->get_source_file_for_handle('bbcode.html');
$extimgaslink_boardurl = generate_board_url() . '/';
$url = $this->helper->route('tas2580_imageproxy_main', array());
$bbcode_cache[$bbcode_id] = array('preg' => array('#\\[img:$uid\\](' . preg_quote($extimgaslink_boardurl, '#') . '.*?)\\[/img:$uid\\]#s' => $bbcode->bbcode_tpl('img', $bbcode_id), '#\\[img:$uid\\](.*?)\\[/img:$uid\\]#s' => str_replace('$1', $url . '?img=$1', $bbcode->bbcode_tpl('img', $bbcode_id, true))));
$event['bbcode_cache'] = $bbcode_cache;
}