本文整理匯總了PHP中Render::include_script方法的典型用法代碼示例。如果您正苦於以下問題:PHP Render::include_script方法的具體用法?PHP Render::include_script怎麽用?PHP Render::include_script使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Render
的用法示例。
在下文中一共展示了Render::include_script方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: post
public static function post($buffer = '')
{
if (Router::is_api_request()) {
return $buffer;
}
// additional processes added by ctrls
foreach (self::$processes as $proc) {
$buffer = $proc($buffer);
}
// custom angular directives
$buffer = preg_replace_callback("/data-(md-[a-z][^=\\s>]*)/", function ($matches) {
$name = Filter::snake_to_camel($matches[1]);
Render::include_script("app/{$name}");
return $matches[0];
}, $buffer);
// assets
$buffer = preg_replace_callback("/<--([^-]+)-->/", function ($matches) {
return Render::$matches[1]();
}, $buffer);
// href and src urls
$buffer = preg_replace_callback('/="(\\/[^"]*)/', function ($matches) {
return '="' . SUBDIR . $matches[1];
}, $buffer);
// css urls
$buffer = preg_replace_callback("/\\((\\/[^)]*)/", function ($matches) {
return "(" . SUBDIR . $matches[1];
}, $buffer);
return $buffer;
}
示例2: get_ref
public function get_ref($params = [])
{
//echo '<pre>'; print_r($params); echo '</pre>'; exit;
if (isset($params['_escaped_fragment_'])) {
$file_name = substr($params['_escaped_fragment_'], 5);
$context = ['page' => $file_name, 'link_style' => -1];
$content = Template::render_doc_by_name('basic-ref', $context);
Render::html($content);
} else {
Render::include_script("app/mdCode");
parent::doc($params);
}
}