Zend framework2 ZF2中的资产管理

Zend framework2 ZF2中的资产管理,zend-framework2,Zend Framework2,我们如何基于ZF2中的模块管理资产 例如: 用户模块有特定的js和css 我们将如何在用户模块中分配js和css文件路径以在布局中显示它 作为 回显此->inlineScript() 或者我们是否需要依赖Assetmanager等外部模块来完成此任务,毫无疑问,每个模块都有各自的视图(例如index.phtml、add.phtml等) 尝试将这样的条目添加到那些模块特定的文件中 <?php $this->headLink()->appendStylesheet('htt

我们如何基于ZF2中的模块管理资产

例如: 用户模块有特定的js和css

我们将如何在用户模块中分配js和css文件路径以在布局中显示它 作为 回显此->inlineScript()


或者我们是否需要依赖Assetmanager等外部模块来完成此任务,毫无疑问,每个模块都有各自的视图(例如index.phtml、add.phtml等)

尝试将这样的条目添加到那些模块特定的文件中

    <?php $this->headLink()->appendStylesheet('http://fonts.googleapis.com/css?family=Happy+Monkey');?>
    <?php $this->headLink()->appendStylesheet($this->basePath('User/css/style.css'));?>
    <?php $this->headScript()->appendFile('http://code.jquery.com/jquery-1.4.2.min.js'); ?>
    <?php $this->headScript()->appendFile($this->basePath('User/js/user.js')); ?>

毫无疑问,每个模块都有各自的视图(例如index.phtml、add.phtml等)

尝试将这样的条目添加到那些模块特定的文件中

    <?php $this->headLink()->appendStylesheet('http://fonts.googleapis.com/css?family=Happy+Monkey');?>
    <?php $this->headLink()->appendStylesheet($this->basePath('User/css/style.css'));?>
    <?php $this->headScript()->appendFile('http://code.jquery.com/jquery-1.4.2.min.js'); ?>
    <?php $this->headScript()->appendFile($this->basePath('User/js/user.js')); ?>


$this->headLink和$this->headScript在再次调用$this->content-in-layout函数获取触发器时两次追加文件$this->headLink和$this->headScript在再次调用$this->content-in-layout函数获取触发器时两次追加文件