如何在视图文件中包含css

Nav*_*eep 7 zend-framework

我已将css包含在视图文件中,如下所示

<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl('style/root.css'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl('style/reset.css'); ?>" />
Run Code Online (Sandbox Code Playgroud)

但它给出了这个错误 - >

  <b>Message:</b> Invalid controller specified (style)  </p>
Run Code Online (Sandbox Code Playgroud)

在application.ini中,我使用过这个

resources.frontController.baseUrl = "/zendtest/public"
resources.view[] = "";
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

max*_*ver 14

在任何视图文件(.phtml扩展名)中使用类似这样的javascript或css:

$this->headScript()->prependFile('/scripts/jquery.min.js');
$this->headScript()->appendFile('/scripts/fg.menu.js');

$this->headLink()->appendStylesheet('/css/form.css');
$this->headLink()->prependStylesheet('/css/jquery_ui_theme/jquery-ui.custom.css');
Run Code Online (Sandbox Code Playgroud)

  • 不,css&js进入/ application/public/css和/ application/public/js (2认同)