本文整理汇总了PHP中HTML::script方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::script方法的具体用法?PHP HTML::script怎么用?PHP HTML::script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML
的用法示例。
在下文中一共展示了HTML::script方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderScripts
public static function renderScripts(){
if (count(self::$_scripts) == 0)
return FALSE;
self::$_scripts = array_unique(self::$_scripts);
// kohana:: $environment
if ( kohana::$environment == Kohana::DEVELOPMENT){
foreach (self::$_scripts as $js){
echo HTML::script("media/scripts/".$js);
}
}else{
$js = implode( ",", self::$_scripts);
?><script type="text/javascript" src="<?php
echo url::base();
?>
min/index.php?b=media/scripts&f=<?php
echo $js;
?>
"></script><?
}
}
示例2: reset_database
public function reset_database()
{
$this->layout->title = "NOSH ChartingSystem Reset Database";
$this->layout->style = '';
$this->layout->script = HTML::script('/js/reset.js');
$this->layout->content = View::make('reset_database');
}
示例3: addScript
/**
* Add script
*
* @param string $path
* @param string $group
*/
public function addScript($path, $group = 'default')
{
if (Filesystem::getExtension($path) == 'js') {
isset($this->scripts->{$group}) or $this->scripts->{$group} = new Core_ArrayObject();
$this->scripts->{$group}->{$path} = HTML::script(self::preparePath($path));
}
}
示例4: showUpdate
/**
* add/update agency
* @param integer $id
*/
function showUpdate($id = 0)
{
$this->data['id'] = $id;
View::share('jsTag', HTML::script("{$this->assetURL}js/select.js"));
// get list Category
$categoryModel = new CategoryBaseModel();
$this->data['listCategory'] = $categoryModel->getAllForm(0);
// get list Ad Format
$AdFormatModel = new AdFormatBaseModel();
$this->data['listAdFormat'] = $AdFormatModel->getAllForm();
// get list Type
$this->data['listAdType'] = Config::get('data.ad_type');
// get list Wmode
$this->data['listWmode'] = Config::get('data.wmode');
// WHEN UPDATE SHOW CURRENT INFOMATION
if ($id != 0) {
$item = $this->model->with('campaign', 'adFormat')->find($id);
if ($item) {
$this->data['item'] = $item;
} else {
return Redirect::to($this->moduleURL . 'show-list');
}
}
if (Request::isMethod('post')) {
if ($this->postUpdate($id, $this->data)) {
return $this->redirectAfterSave(Input::get('save'));
}
}
$this->layout->content = View::make('showUpdate', $this->data);
}
示例5: showUpdate
/**
* add/update agency
* @param integer $id
*/
function showUpdate($id = 0)
{
$this->data['id'] = $id;
View::share('jsTag', HTML::script("{$this->assetURL}js/select.js"));
// get list country
$countryModel = new CountryBaseModel();
$this->data['listCountry'] = $countryModel->getAllForm();
// get list Category
$categoryModel = new CategoryBaseModel();
$this->data['listCategory'] = $categoryModel->getAllForm();
// get expected close month
$this->data['listExpectedCloseMonth'] = getMonthRange();
// get list Currency
$currencyModel = new CurrencyBaseModel();
$this->data['listCurrency'] = $currencyModel->getAllForm();
// get list Sale Status
$this->data['listSaleStatus'] = Config::get('data.sale_status');
$this->loadLeftMenu('menu.campaignList');
// WHEN UPDATE SHOW CURRENT INFORMATION
if ($id != 0) {
$item = $this->model->with('agency', 'advertiser', 'sale', 'campaign_manager')->find($id);
if ($item) {
$this->data['item'] = $item;
$this->loadLeftMenu('menu.campaignUpdate', array('item' => $item));
} else {
return Redirect::to($this->moduleURL . 'show-list');
}
}
if (Request::isMethod('post')) {
if ($this->postUpdate($id, $this->data)) {
return Redirect::to($this->moduleURL . 'view/' . $this->data['id']);
}
}
$this->layout->content = View::make('showUpdate', $this->data);
}
示例6: showUpdate
/**
* add/update agency
* @param integer $id
*/
function showUpdate($id = 0)
{
$this->data['id'] = $id;
View::share('jsTag', HTML::script("{$this->assetURL}js/select.js"));
// get list Category
$categoryModel = new CategoryBaseModel();
$this->data['listCategory'] = $categoryModel->getAllForm(0, 0, 'Run of Network');
// get list Flight Objective
$this->data['listFlightObjective'] = Config::get('data.flight_objective');
$this->loadLeftMenu('menu.flightList');
// WHEN UPDATE SHOW CURRENT INFOMATION
if ($id != 0) {
$this->loadLeftMenu('menu.flightUpdate');
$item = $this->model->with('category', 'campaign', 'publisher', 'publisherSite', 'publisher_ad_zone')->find($id);
if ($item) {
$this->data['item'] = $item;
} else {
return Redirect::to($this->moduleURL . 'show-list');
}
}
if (Request::isMethod('post')) {
if ($this->postUpdate($id, $this->data)) {
return $this->redirectAfterSave(Input::get('save'));
}
}
$this->layout->content = View::make('showUpdate', $this->data);
}
示例7: add
public static function add($url, $attributes = array())
{
if (Str::endsWith($url, '.js')) {
$url .= '?v=' . rand(0, 999);
$asset = \HTML::script($url, $attributes);
$nscript = array('url' => $url, 'html' => $asset);
$am = Session::get('asset_manager_js', array());
foreach ($am as $script) {
if ($url == $script['url']) {
return false;
}
}
$am[] = $nscript;
Session::put('asset_manager_js', $am);
} elseif (Str::endsWith($url, '.css')) {
$url .= '?v=' . rand(0, 999);
$asset = \HTML::style($url, $attributes);
$nstyle = array('url' => $url, 'html' => $asset);
$am = Session::get('asset_manager_css', array());
foreach ($am as $style) {
if ($url == $style['url']) {
return false;
}
}
$am[] = $nstyle;
Session::put('asset_manager_css', $am);
return true;
}
}
示例8: action_make
public function action_make()
{
echo HTML::script('media/js/qrcode.min.js');
$text = Arr::get($_GET, 'text', '');
$width = Arr::get($_GET, 'width', '');
echo QRJS::makecode($text, $width);
exit;
}
示例9: get_scripts_html
/**
* Gets the default js scripts for the rte
*
* @return string
*/
public static function get_scripts_html()
{
$html = array();
foreach (self::_get_config('scripts') as $script) {
$html[] = HTML::script(url::base() . $script);
}
return implode("\n", $html);
}
示例10: get_jquery
function get_jquery($echo = false)
{
if ($echo == true) {
echo HTML::script('/assets/js/jquery.js');
} else {
return HTML::script('/assets/js/jquery.js');
}
}
示例11: hookHead
/**
* Вывод глобальный переменных в заголовке
*/
public function hookHead()
{
$cogear = new Core_ArrayObject();
$cogear->settings = new Core_ArrayObject();
$cogear->settings->site = SITE_URL;
event('assets.js.global', $cogear);
echo HTML::script("var cogear = cogear || " . json_encode($cogear) . ";\n\n window.cogear = cogear;", array(), TRUE);
}
示例12: script
/**
* 脚本别名加载(支持批量加载,后期可拓展为自动多文件压缩合并)
* @return string
*/
function script()
{
$scriptArray = array_map(function ($aliases) {
$jsUrl = asset_static($aliases);
return HTML::script($jsUrl);
}, func_get_args());
return implode('', array_filter($scriptArray));
}
示例13: include_library
/**
*
* get the JS library that we need to generate charts
* @param boolean $force forces the inclusion
* @return string
*/
public static function include_library($force = FALSE)
{
if (self::$included_lib == FALSE or $force == TRUE) {
self::$included_lib = TRUE;
return HTML::script((Core::is_HTTPS() ? 'https:' : 'http:') . '//www.google.com/jsapi') . PHP_EOL;
}
return FALSE;
}
示例14: scripts
public function scripts()
{
$this->addCustomScripts();
$result = '';
foreach ($this->scripts as $i => $file) {
$result .= \HTML::script($file);
}
return $result;
}
示例15: testGeneratingScript
/**
* Test generating a link to JavaScript files
*
* @group laravel
*/
public function testGeneratingScript()
{
$html1 = HTML::script('foo.js');
$html2 = HTML::script('http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js');
$html3 = HTML::script('foo.js', array('type' => 'text/javascript'));
$this->assertEquals('<script src="http://localhost/foo.js"></script>' . PHP_EOL, $html1);
$this->assertEquals('<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>' . PHP_EOL, $html2);
$this->assertEquals('<script src="http://localhost/foo.js" type="text/javascript"></script>' . PHP_EOL, $html3);
}