baseUrl('style/reset.css'); ?>" /> 但它给出了这个-6ren">
gpt4 book ai didi

zend-framework - 如何在 View 文件中包含css

转载 作者:行者123 更新时间:2023-12-04 10:01:25 25 4
gpt4 key购买 nike

我在 View 文件中包含了 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'); ?>" />

但它给出了这个错误->
  <b>Message:</b> Invalid controller specified (style)  </p>

在application.ini中,我用过这个
resources.frontController.baseUrl = "/zendtest/public"
resources.view[] = "";

我该如何解决这个问题?

最佳答案

在任何 View 文件(.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');

关于zend-framework - 如何在 View 文件中包含css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10209736/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com