當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Web::enqueueStyle方法代碼示例

本文整理匯總了PHP中Web::enqueueStyle方法的典型用法代碼示例。如果您正苦於以下問題:PHP Web::enqueueStyle方法的具體用法?PHP Web::enqueueStyle怎麽用?PHP Web::enqueueStyle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Web的用法示例。


在下文中一共展示了Web::enqueueStyle方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: admin_ALL

function admin_ALL(Web $w)
{
    History::add("Workhours Admin");
    $w->ctx("workperiods", $w->Bend->getAllWorkPeriods());
    $w->ctx("focusgroups", $w->Bend->getTopLevelWorkCategories());
    $w->enqueueStyle(["uri" => "/modules/bend/assets/css/bend.css", "weight" => 500]);
}
開發者ID:careck,項目名稱:bendms,代碼行數:7,代碼來源:admin.php

示例2: testEnqueueAndOutputStyle

 /**
  * Testing Web->enqueueStyle($style)
  */
 public function testEnqueueAndOutputStyle()
 {
     self::$web->enqueueStyle(array("name" => "style.css", "uri" => "/system/style.css", "weight" => 10));
     // Test one script
     $this->assertEquals(count(self::$web->_styles), 1);
     $this->assertEquals($this->captureOutput(self::$web, 'outputStyles'), "<link rel='stylesheet' href='/system/style.css'/>");
     // Test a second script
     self::$web->enqueueStyle(array("name" => "jquery.css", "uri" => "/system/jquery.css", "weight" => 50));
     $this->assertEquals(count(self::$web->_styles), 2);
     $this->assertEquals($this->captureOutput(self::$web, 'outputStyles'), "<link rel='stylesheet' href='/system/jquery.css'/><link rel='stylesheet' href='/system/style.css'/>");
     // Test that adding a previous value isnt duplicated
     self::$web->enqueueStyle(array("name" => "jquery.css", "uri" => "/system/jquery.css", "weight" => 50));
     $this->assertEquals(count(self::$web->_styles), 2);
     $this->assertEquals($this->captureOutput(self::$web, 'outputStyles'), "<link rel='stylesheet' href='/system/jquery.css'/><link rel='stylesheet' href='/system/style.css'/>");
     // Test weight based sorting by injecting another style which should sort to the middle
     self::$web->enqueueStyle(array("name" => "mine.css", "uri" => "/eek/mine.css", "weight" => 20));
     $this->assertEquals(count(self::$web->_styles), 3);
     $this->assertEquals($this->captureOutput(self::$web, 'outputStyles'), "<link rel='stylesheet' href='/system/jquery.css'/><link rel='stylesheet' href='/eek/mine.css'/><link rel='stylesheet' href='/system/style.css'/>");
 }
開發者ID:careck,項目名稱:bendms,代碼行數:22,代碼來源:ExampleTest.php

示例3: bend_core_web_after_get_bend

/**
 * inject font awesome and our css for every action in the bend module
 * 
 * @param Web $w
 */
function bend_core_web_after_get_bend(Web $w)
{
    $w->enqueueStyle(["uri" => "/modules/bend/assets/css/bend.css", "weight" => 500]);
    $w->enqueueStyle(["uri" => "/modules/bend/assets/css/font-awesome.min.css", "weight" => 501]);
}
開發者ID:careck,項目名稱:bendms,代碼行數:10,代碼來源:bend.hooks.php


注:本文中的Web::enqueueStyle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。