本文整理汇总了PHP中Assets::javascript_path方法的典型用法代码示例。如果您正苦于以下问题:PHP Assets::javascript_path方法的具体用法?PHP Assets::javascript_path怎么用?PHP Assets::javascript_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assets
的用法示例。
在下文中一共展示了Assets::javascript_path方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeScript
/**
* Remove a JavaScript SCRIPT element from the HTML HEAD section.
*
* @param string $source URL of JS file or file in assets folder
* @param array $attributes Additional parameters for the script tag
*/
public static function removeScript($source, $attributes = array())
{
$attributes['src'] = Assets::javascript_path($source);
self::removeHeadElement('script', $attributes);
}
示例2: test_javascript_path_should_not_touch_absolute_paths
function test_javascript_path_should_not_touch_absolute_paths()
{
$url = Assets::javascript_path('/some/script.js');
$this->assertEquals(STATIC_ASSETS_URL . 'some/script.js', $url);
}
示例3: script
/**
* Returns a script include tag per source given as argument.
*
* Examples:
*
* Assets::script('prototype') =>
* <script src="/javascript/prototype.js"></script>
*
* Assets::script('common.javascript', '/elsewhere/cools') =>
* <script src="/js/common.javascript"></script>
* <script src="/elsewhere/cools.js"></script>
*/
static function script($atLeastOneArgument)
{
$html = '';
foreach (func_get_args() as $source) {
$source = Assets::javascript_path($source);
$html .= Assets::content_tag('script', '', array('src' => $source));
$html .= "\n";
}
return $html;
}