本文整理匯總了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;
}
示例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);
}
示例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);
}
示例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');
}
示例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;
}