當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。