zend-framework – 如何在视图文件中包含css
发布时间:2020-12-13 18:22:25 所属栏目:PHP教程 来源:网络整理
导读:我已将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'); ?" / 但它给出了这个错误
我已将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[] = ""; 我该如何解决这个问题?
在任何视图文件(.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'); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |