當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tag::javascriptInclude方法代碼示例

本文整理匯總了PHP中Phalcon\Tag::javascriptInclude方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tag::javascriptInclude方法的具體用法?PHP Tag::javascriptInclude怎麽用?PHP Tag::javascriptInclude使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Phalcon\Tag的用法示例。


在下文中一共展示了Tag::javascriptInclude方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: outputJs

 /**
  * Prints the HTML for JS resources
  *
  * @param string $collectionName the name of the collection
  *
  * @return string the result of the collection
  **/
 public function outputJs($collectionName = null)
 {
     $collection = $this->collection($collectionName);
     if ($collection->getJoin()) {
         $filename = $collection->getTargetPath();
         if (file_exists($filename)) {
             $time = 0;
             foreach ($collection->getResources() as $resource) {
                 $tmp = filemtime($resource->getRealTargetPath());
                 if ($tmp > $time) {
                     $time = $tmp;
                 }
             }
             // If created
             if (filemtime($filename) > $time) {
                 $collection->setTargetUri($collection->getTargetUri() . '?' . filemtime($filename));
                 return Tag::javascriptInclude($collection->getTargetUri());
             }
         }
         // Else CREATE
         $res = parent::outputJs($collectionName);
         return $res;
     }
     return parent::outputJs($collectionName);
 }
開發者ID:atduarte,項目名稱:allsos,代碼行數:32,代碼來源:AssetsManager.php

示例2: registryFunctions

 /**
  * Registers common function in Twig
  *
  * @param \Phalcon\Mvc\ViewInterface $view
  * @param \Phalcon\DiInterface       $di
  * @param array                      $userFunctions
  */
 protected function registryFunctions($view, DiInterface $di, $userFunctions = array())
 {
     $options = array('is_safe' => array('html'));
     $functions = array(new \Twig_SimpleFunction('content', function () use($view) {
         return $view->getContent();
     }, $options), new \Twig_SimpleFunction('partial', function ($partialPath) use($view) {
         return $view->partial($partialPath);
     }, $options), new \Twig_SimpleFunction('linkTo', function ($parameters, $text = null) {
         return \Phalcon\Tag::linkTo($parameters, $text);
     }, $options), new \Twig_SimpleFunction('textField', function ($parameters) {
         return \Phalcon\Tag::textField($parameters);
     }, $options), new \Twig_SimpleFunction('passwordField', function ($parameters) {
         return \Phalcon\Tag::passwordField($parameters);
     }, $options), new \Twig_SimpleFunction('hiddenField', function ($parameters) {
         return \Phalcon\Tag::hiddenField($parameters);
     }, $options), new \Twig_SimpleFunction('fileField', function ($parameters) {
         return \Phalcon\Tag::fileField($parameters);
     }, $options), new \Twig_SimpleFunction('checkField', function ($parameters) {
         return \Phalcon\Tag::checkField($parameters);
     }, $options), new \Twig_SimpleFunction('radioField', function ($parameters) {
         return \Phalcon\Tag::radioField($parameters);
     }, $options), new \Twig_SimpleFunction('submitButton', function ($parameters) {
         return \Phalcon\Tag::submitButton($parameters);
     }, $options), new \Twig_SimpleFunction('selectStatic', function ($parameters, $data = array()) {
         return \Phalcon\Tag::selectStatic($parameters, $data);
     }, $options), new \Twig_SimpleFunction('select', function ($parameters, $data = array()) {
         return \Phalcon\Tag::select($parameters, $data);
     }, $options), new \Twig_SimpleFunction('textArea', function ($parameters) {
         return \Phalcon\Tag::textArea($parameters);
     }, $options), new \Twig_SimpleFunction('form', function ($parameters = array()) {
         return \Phalcon\Tag::form($parameters);
     }, $options), new \Twig_SimpleFunction('endForm', function () {
         return \Phalcon\Tag::endForm();
     }, $options), new \Twig_SimpleFunction('getTitle', function () {
         return \Phalcon\Tag::getTitle();
     }, $options), new \Twig_SimpleFunction('stylesheetLink', function ($parameters = null, $local = true) {
         return \Phalcon\Tag::stylesheetLink($parameters, $local);
     }, $options), new \Twig_SimpleFunction('javascriptInclude', function ($parameters = null, $local = true) {
         return \Phalcon\Tag::javascriptInclude($parameters, $local);
     }, $options), new \Twig_SimpleFunction('image', function ($parameters) {
         return \Phalcon\Tag::image($parameters);
     }, $options), new \Twig_SimpleFunction('friendlyTitle', function ($text, $separator = null, $lowercase = true) {
         return \Phalcon\Tag::friendlyTitle($text, $separator, $lowercase);
     }, $options), new \Twig_SimpleFunction('getDocType', function () {
         return \Phalcon\Tag::getDocType();
     }, $options), new \Twig_SimpleFunction('getSecurityToken', function () use($di) {
         return $di->get("security")->getToken();
     }, $options), new \Twig_SimpleFunction('getSecurityTokenKey', function () use($di) {
         return $di->get("security")->getTokenKey();
     }, $options), new \Twig_SimpleFunction('url', function ($route) use($di) {
         return $di->get("url")->get($route);
     }, $options));
     if (!empty($userFunctions)) {
         $functions = array_merge($functions, $userFunctions);
     }
     foreach ($functions as $function) {
         $this->twig->addFunction($function);
     }
 }
開發者ID:lisong,項目名稱:incubator,代碼行數:66,代碼來源:Twig.php

示例3: importResources

 /**
  * Import CodeMirror resources
  *
  * @return void
  */
 public static function importResources()
 {
     echo Tag::javascriptInclude('js/codemirror/lib/codemirror.js');
     echo Tag::javascriptInclude('js/codemirror/mode/clike/clike.js');
     echo Tag::javascriptInclude('js/codemirror/mode/xml/xml.js');
     echo Tag::javascriptInclude('js/codemirror/mode/css/css.js');
     echo Tag::javascriptInclude('js/codemirror/mode/php/php.js');
     echo Tag::javascriptInclude('js/codemirror/lib/codephalcon.js');
     echo Tag::stylesheetLink('css/codemirror/codemirror.css');
     echo Tag::stylesheetLink('css/codemirror/codephalcon.css');
 }
開發者ID:doit76,項目名稱:phalcon-devtools,代碼行數:16,代碼來源:CodeMirror.php

示例4: registryFunctions

 /**
  * Registers common function in Twig
  *
  * @param \Phalcon\Mvc\ViewInterface $view
  */
 private function registryFunctions($view)
 {
     $options = array('is_safe' => array('html'));
     $functions = array(new \Twig_SimpleFunction('content', function () use($view) {
         return $view->getContent();
     }, $options), new \Twig_SimpleFunction('partial', function ($partialPath) use($view) {
         return $view->partial($partialPath);
     }, $options), new \Twig_SimpleFunction('linkTo', function ($parameters, $text = null) {
         return \Phalcon\Tag::linkTo($parameters, $text);
     }, $options), new \Twig_SimpleFunction('textField', function ($parameters) {
         return \Phalcon\Tag::textField($parameters);
     }, $options), new \Twig_SimpleFunction('passwordField', function ($parameters) {
         return \Phalcon\Tag::passwordField($parameters);
     }, $options), new \Twig_SimpleFunction('hiddenField', function ($parameters) {
         return \Phalcon\Tag::hiddenField($parameters);
     }, $options), new \Twig_SimpleFunction('fileField', function ($parameters) {
         return \Phalcon\Tag::fileField($parameters);
     }, $options), new \Twig_SimpleFunction('checkField', function ($parameters) {
         return \Phalcon\Tag::checkField($parameters);
     }, $options), new \Twig_SimpleFunction('radioField', function ($parameters) {
         return \Phalcon\Tag::radioField($parameters);
     }, $options), new \Twig_SimpleFunction('submitButton', function ($parameters) {
         return \Phalcon\Tag::submitButton($parameters);
     }, $options), new \Twig_SimpleFunction('selectStatic', function ($parameters, $data = []) {
         return \Phalcon\Tag::selectStatic($parameters, $data);
     }, $options), new \Twig_SimpleFunction('select', function ($parameters, $data = []) {
         return \Phalcon\Tag::select($parameters, $data);
     }, $options), new \Twig_SimpleFunction('textArea', function ($parameters) {
         return \Phalcon\Tag::textArea($parameters);
     }, $options), new \Twig_SimpleFunction('form', function ($parameters = []) {
         return \Phalcon\Tag::form($parameters);
     }, $options), new \Twig_SimpleFunction('endForm', function () {
         return \Phalcon\Tag::endForm();
     }, $options), new \Twig_SimpleFunction('getTitle', function () {
         return \Phalcon\Tag::getTitle();
     }, $options), new \Twig_SimpleFunction('getTitle', function () {
         return \Phalcon\Tag::getTitle();
     }, $options), new \Twig_SimpleFunction('stylesheetLink', function ($parameters = null, $local = true) {
         return \Phalcon\Tag::stylesheetLink($parameters, $local);
     }, $options), new \Twig_SimpleFunction('javascriptInclude', function ($parameters = null, $local = true) {
         return \Phalcon\Tag::javascriptInclude($parameters, $local);
     }, $options), new \Twig_SimpleFunction('image', function ($parameters) {
         return \Phalcon\Tag::image($parameters);
     }, $options), new \Twig_SimpleFunction('friendlyTitle', function ($text, $separator = null, $lowercase = true) {
         return \Phalcon\Tag::friendlyTitle($text, $separator, $lowercase);
     }, $options), new \Twig_SimpleFunction('getDocType', function () {
         return \Phalcon\Tag::getDocType();
     }, $options));
     foreach ($functions as $function) {
         $this->_twig->addFunction($function);
     }
 }
開發者ID:tashik,項目名稱:phalcon_core,代碼行數:57,代碼來源:Twig.php

示例5: importResources

 /**
  * Import CodeMirror resources
  *
  * @return void
  */
 public static function importResources()
 {
     echo Tag::stylesheetLink('css/codemirror/ambiance.css');
     echo Tag::stylesheetLink('css/codemirror/codemirror.css');
     echo Tag::javascriptInclude('js/codemirror/lib/codemirror.js');
     echo Tag::javascriptInclude('js/codemirror/addon/edit/matchbrackets.js');
     echo Tag::javascriptInclude('js/codemirror/addon/selection/active-line.js');
     echo Tag::javascriptInclude('js/codemirror/mode/clike/clike.js');
     echo Tag::javascriptInclude('js/codemirror/mode/htmlmixed/htmlmixed.js');
     echo Tag::javascriptInclude('js/codemirror/mode/xml/xml.js');
     echo Tag::javascriptInclude('js/codemirror/mode/css/css.js');
     echo Tag::javascriptInclude('js/codemirror/mode/php/php.js');
     echo Tag::javascriptInclude('js/codemirror/lib/codephalcon.js');
     echo Tag::stylesheetLink('css/codemirror/codephalcon.css');
 }
開發者ID:ntamvl,項目名稱:phalcon-devtools,代碼行數:20,代碼來源:CodeMirror.php

示例6: outputJs

 /**
  * Prints the HTML for JS resources.
  *
  * @param string $collectionName the name of the collection
  *
  * @return string
  **/
 public function outputJs($collectionName = self::DEFAULT_COLLECTION_JS)
 {
     $remote = $this->_config->application->assets->get('remote');
     $collection = $this->collection($collectionName);
     if (!$remote && $collection->getJoin()) {
         $local = $this->_config->application->assets->get('local');
         $lifetime = $this->_config->application->assets->get('lifetime', 0);
         $filepath = $local . self::GENERATED_STORAGE_PATH . ($filename = $filename = $this->getCollectionFileName($collection, self::FILENAME_PATTERN_JS));
         $collection->setTargetPath($filepath)->setTargetUri($filepath);
         if ($this->_cache->exists($filename)) {
             return Tag::javascriptInclude($collection->getTargetUri());
         }
         $res = parent::outputJs($collectionName);
         $this->_cache->save($filename, true, $lifetime);
         return $res;
     }
     return parent::outputJs($collectionName);
 }
開發者ID:biggtfish,項目名稱:cms,代碼行數:25,代碼來源:Manager.php

示例7: foreach

<?php

foreach ($this->assets->collection('js') as $resource) {
    echo \Phalcon\Tag::javascriptInclude($resource->getPath());
}
開發者ID:aodkrisda,項目名稱:phalcon-code,代碼行數:5,代碼來源:assets-149.php

示例8: javascriptInclude

 public static function javascriptInclude($parameters = null, $local = true)
 {
     return parent::javascriptInclude($parameters, $local);
 }
開發者ID:mattvb91,項目名稱:cphalcon,代碼行數:4,代碼來源:Tag.php

示例9: builderStyle

    function builderStyle()
    {
        echo '<style>
 .dropzone-dashboard {
  background-color: #ffffff;
  min-height: 55px;
  float: left;
  margin-bottom: 5px;
  margin-top: 5px;
  opacity: 0.9;
  padding: 0;
  position: relative;
  transition: opacity 200ms ease;
  width: 100%;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  -ms-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

.dropzone-dashboard.active {
  opacity: 1;
}


.hover {
  background: #EEE;
  margin:8px;
  min-height: 45px;
  position: relative;
  width: 100%;
  -webkit-transition: opacity 0.2s ease;
  -moz-transition: opacity 0.2s ease;
  -o-transition: opacity 0.2s ease;
  -ms-transition: opacity 0.2s ease;
  transition: opacity 0.2s ease;
}

</style>';
        echo '<style>
 .dropzone-portlet {
  background-color: #ffffff;
  min-height: 55px;
  float: left;
  margin-bottom: 5px;
  margin-top: 5px;
  opacity: 0.9;
  padding: 0;
  position: relative;
  transition: opacity 200ms ease;
  width: 100%;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  -ms-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

.dropzone-portlet.active {
  opacity: 1;
}


.hover {
  background: #EEE;
  margin:8px;
  min-height: 45px;
  position: relative;
  width: 100%;
  -webkit-transition: opacity 0.2s ease;
  -moz-transition: opacity 0.2s ease;
  -o-transition: opacity 0.2s ease;
  -ms-transition: opacity 0.2s ease;
  transition: opacity 0.2s ease;
}

</style>';
        echo \Phalcon\Tag::javascriptInclude('assets/global/plugins/jquery-ui/jquery-ui-droppable-iframe-fix.js');
        echo \Phalcon\Tag::stylesheetLink("https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.all.css");
    }
開發者ID:enricowillemse,項目名稱:prime_admin,代碼行數:81,代碼來源:DashboardBase.php

示例10: testJavascriptIncludeWithStringAsSecondParameterRemoteXHTML

 /**
  * Tests javascriptInclude with a string as the second parameter - remote link
  *
  * @author Nikos Dimopoulos <nikos@phalconphp.com>
  * @since  2012-10-26
  */
 public function testJavascriptIncludeWithStringAsSecondParameterRemoteXHTML()
 {
     \Phalcon\Tag::setDoctype(\Phalcon\Tag::XHTML10_STRICT);
     $options = 'http://my.local.com/js/phalcon.js';
     $expected = '<script type="text/javascript" src="http://my.local.com/js/phalcon.js"></script>' . PHP_EOL;
     $actual = \Phalcon\Tag::javascriptInclude($options, '0');
     \Phalcon\Tag::setDoctype('');
     $this->assertEquals($expected, $actual, sprintf($this->message, 'JavascriptInclude remote with string as second parameter'));
 }
開發者ID:lisong,項目名稱:cphalcon,代碼行數:15,代碼來源:UnitTest.php

示例11: testIssue1486

 public function testIssue1486()
 {
     $di = new Phalcon\DI\FactoryDefault();
     $di->getshared('url')->setBaseUri('/');
     \Phalcon\Tag::setDI($di);
     $html = \Phalcon\Tag::stylesheetLink('css/phalcon.css');
     $this->assertEquals($html, '<link rel="stylesheet" href="/css/phalcon.css" type="text/css" />' . PHP_EOL);
     $html = \Phalcon\Tag::stylesheetLink(array('css/phalcon.css'));
     $this->assertEquals($html, '<link rel="stylesheet" href="/css/phalcon.css" type="text/css" />' . PHP_EOL);
     $html = \Phalcon\Tag::javascriptInclude('js/phalcon.js');
     $this->assertEquals($html, '<script src="/js/phalcon.js" type="text/javascript"></script>' . PHP_EOL);
     $html = \Phalcon\Tag::javascriptInclude(array('js/phalcon.js'));
     $this->assertEquals($html, '<script src="/js/phalcon.js" type="text/javascript"></script>' . PHP_EOL);
 }
開發者ID:aisuhua,項目名稱:phalcon-php,代碼行數:14,代碼來源:TagTest.php

示例12: includeModernizr

 private function includeModernizr()
 {
     return Tag::javascriptInclude('js/modernizr-2.8.3.js');
 }
開發者ID:fenghuilee,項目名稱:Talon,代碼行數:4,代碼來源:ControllerBase.php

示例13: getJs

 public function getJs()
 {
     return Tag::javascriptInclude('https://www.google.com/recaptcha/api.js', false);
 }
開發者ID:phalcon,項目名稱:forum,代碼行數:4,代碼來源:ReCaptcha.php

示例14:

<?php

// Generate <script src="http://localhost/javascript/jquery.min.js" type="text/javascript"></script>
echo \Phalcon\Tag::javascriptInclude("http://localhost/javascript/jquery.min.js", false);
// Generate <script src="/your-app/javascript/jquery.min.js" type="text/javascript"></script>
echo \Phalcon\Tag::javascriptInclude("javascript/jquery.min.js");
開發者ID:aodkrisda,項目名稱:phalcon-code,代碼行數:6,代碼來源:tags-493.php

示例15: javascriptInclude

 public static function javascriptInclude($parameters = null, $local = null)
 {
     return Tag::javascriptInclude($parameters, $local);
 }
開發者ID:aleboisselier,項目名稱:phalcon-jquery,代碼行數:4,代碼來源:PhalconUtils.php


注:本文中的Phalcon\Tag::javascriptInclude方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。