2013-04-04 52 views
1

我想複製下面的語法在Zend的2型如何在zend framework 2語法中寫下CSS行?

"link rel="stylesheet" media="all" href="css/main.css" />" 
"link rel="stylesheet" media="screen" href="css/enhanced.css" />" 

請幫助任何人。

+2

Waaaaaaaaaaaaat? – 2013-04-04 09:28:22

回答

1

您正在尋找的headlink view helper

以下是骨架應用程序的一些演示代碼:

<head> 
     <meta charset="utf-8"> 
     <?php echo $this->headTitle('ZF2 '. $this->translate('Skeleton Application'))->setSeparator(' - ')->setAutoEscape(false) ?> 

     <?php echo $this->headMeta()->appendName('viewport', 'width=device-width, initial-scale=1.0') ?> 

     <!-- Le styles --> 
     <?php echo $this->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/images/favicon.ico')) 
         ->prependStylesheet($this->basePath() . '/css/bootstrap-responsive.min.css') 
         ->prependStylesheet($this->basePath() . '/css/style.css') 
         ->prependStylesheet($this->basePath() . '/css/bootstrap.min.css') ?> 

     <!-- Scripts --> 
     <?php echo $this->headScript()->prependFile($this->basePath() . '/js/html5.js', 'text/javascript', array('conditional' => 'lt IE 9',)) 
             ->prependFile($this->basePath() . '/js/bootstrap.min.js') 
             ->prependFile($this->basePath() . '/js/jquery.min.js') ?> 

    </head>