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