本文整理汇总了PHP中Requirements::Javascript方法的典型用法代码示例。如果您正苦于以下问题:PHP Requirements::Javascript方法的具体用法?PHP Requirements::Javascript怎么用?PHP Requirements::Javascript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Requirements
的用法示例。
在下文中一共展示了Requirements::Javascript方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
Requirements::css($this->ThemeDir() . "/css/bootstrap.min.css");
Requirements::css("http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic");
Requirements::css("http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800");
Requirements::css($this->ThemeDir() . "/font-awesome/css/font-awesome.min.css");
Requirements::css($this->ThemeDir() . "/css/animate.min.css");
Requirements::css($this->ThemeDir() . "/css/creative.css");
Requirements::css($this->ThemeDir() . "/css/AboutPage.css");
Requirements::css($this->ThemeDir() . "/css/ContactPage.css");
Requirements::css($this->ThemeDir() . "/css/FAQ.css");
Requirements::css($this->ThemeDir() . "/css/HomePage.css");
Requirements::Javascript($this->ThemeDir() . "/js/jquery.js");
Requirements::Javascript($this->ThemeDir() . "/js/bootstrap.min.js");
Requirements::Javascript($this->ThemeDir() . "/js/jquery.easing.min.js");
Requirements::Javascript($this->ThemeDir() . "/js/jquery.fittext.js");
Requirements::Javascript($this->ThemeDir() . "/js/wow.min.js");
Requirements::Javascript($this->ThemeDir() . "/js/creative.js");
// You can include any CSS or JS required by your project here.
// See: http://doc.silverstripe.org/framework/en/reference/requirements
}
示例2: Field
/**
* Returns a <select> tag containing all the appropriate <option> tags and with add/useExisting link
*/
function Field()
{
//Add these js file so that the DropdownField_WithAdd can work alone (in a webpage, rather than CMS).
Requirements::javascript('jsparty/prototype.js');
Requirements::javascript('jsparty/behaviour.js');
Requirements::javascript('jsparty/prototype_improvements.js');
Requirements::Javascript("sapphire/javascript/DropdownField_WithAdd.js");
$dropdown = parent::Field();
if ($this->addLink) {
$addLink = <<<HTML
<a class="addlink link" id="{$this->name}_addLink" href="{$this->addLink}" style="display: inline; padding-left: 1em; text-decoration: underline;">{$this->addText}</a>
HTML;
}
if ($this->useExistingLink) {
$useExistingLink = <<<HTML
<a class="useExistinglink link" id="{$this->name}_useExistingLink" href="{$this->useExistingLink}" style="display: none; padding-left: 1em; text-decoration: underline;">{$this->useExistingText}</a>
HTML;
}
if ($this->editLink) {
$editLink = <<<HTML
<a class="editlink" id="{$this->name}_editLink" href="{$this->editLink}" style="display: inline; padding-left: 1em; text-decoration: underline;">edit</a>
HTML;
}
return $dropdown . $addLink . $useExistingLink . $editLink;
}