本文整理汇总了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;
}