1

我想以 zend 2 风格复制以下语法

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

请帮助任何人。

4

1 回答 1

1

您正在寻找headlink视图助手

以下是骨架应用程序的一些演示代码:

<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>
于 2013-04-04T09:31:28.237 回答