当前位置: 首页>>代码示例>>PHP>>正文


PHP Requirements::get_custom_scripts方法代码示例

本文整理汇总了PHP中Requirements::get_custom_scripts方法的典型用法代码示例。如果您正苦于以下问题:PHP Requirements::get_custom_scripts方法的具体用法?PHP Requirements::get_custom_scripts怎么用?PHP Requirements::get_custom_scripts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Requirements的用法示例。


在下文中一共展示了Requirements::get_custom_scripts方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: forAjaxTemplate

 function forAjaxTemplate()
 {
     $rendered = parent::forAjaxTemplate();
     if ($scripts = Requirements::get_custom_scripts()) {
         $rendered .= "<script type=\"text/javascript\">\n//<![CDATA[ \n" . $scripts . "</script>";
     }
     return $rendered;
 }
开发者ID:helpfulrobot,项目名称:burnbright-silverstripe-shop-enquiry,代码行数:8,代码来源:EnquiryForm.php

示例2: testRequireJSIncludesAllConfigs

 public function testRequireJSIncludesAllConfigs()
 {
     $c = HtmlEditorConfig::get('configA');
     $c = HtmlEditorConfig::get('configB');
     HtmlEditorConfig::require_js();
     $js = Requirements::get_custom_scripts();
     $this->assertContains('"configA":{', $js);
     $this->assertContains('"configB":{', $js);
 }
开发者ID:miamollie,项目名称:echoAerial,代码行数:9,代码来源:HtmlEditorConfigTest.php

示例3: itDefinesInitialData

 /**
  * @test
  */
 public function itDefinesInitialData()
 {
     $this->objFromFixture('File', 'File2');
     $field = $this->getNewField();
     $field->setCurrentPath('Folder2');
     $field->Field();
     $scripts = Requirements::get_custom_scripts();
     $this->assertContains('"title":"The Second File"', $scripts);
     $this->assertNotContains('"title":"The First File"', $scripts);
 }
开发者ID:unclecheese,项目名称:silverstripe-assets-gallery,代码行数:13,代码来源:AssetGalleryFieldTest.php

示例4: testNoTestsDoesNotIncludeYepnope

 public function testNoTestsDoesNotIncludeYepnope()
 {
     Yepnope::eval_yepnope();
     $scripts = Requirements::get_custom_scripts();
     $javascripts = Requirements::backend()->get_javascript();
     $this->assertEquals('', $scripts, 'YepNope output found, even though no test were added');
     $this->assertEquals(array(), $javascripts, 'YepNope lib was included, even though no tests were added');
 }
开发者ID:helpfulrobot,项目名称:kinglozzer-yepnopesilverstripe,代码行数:8,代码来源:YepnopeTest.php

示例5: get_javascript

 /**
  * @return string Compiled string of javascript-function-calls (needs to be evaluated on the client-side!)
  */
 protected static function get_javascript()
 {
     $js = "";
     // select only one status message (with priority on "bad" messages)
     $msg = "";
     foreach (self::$status_include_order as $status) {
         if (isset(self::$status_messages[$status])) {
             $msg = self::$status_messages[$status];
             break;
         }
     }
     if (!empty($msg)) {
         self::$rules[] = $msg;
     }
     $js .= implode("\n", self::$rules);
     $js .= Requirements::get_custom_scripts();
     // make sure behaviour is applied AFTER all registers are collected
     $js .= implode("\n", self::$behaviour_apply_rules);
     return $js;
 }
开发者ID:nicmart,项目名称:comperio-site,代码行数:23,代码来源:FormResponse.php


注:本文中的Requirements::get_custom_scripts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。