andydune/rzn-view-files-path

一个ZF2模块,允许您轻松更改查看文件(css、js、图片)的路径。

v0.1.0 2014-02-07 10:47 UTC

This package is auto-updated.

Last update: 2024-09-12 19:42:50 UTC


README

一个ZF2模块,允许您轻松更改查看文件(css、js、图片)的路径。

基本使用

这是来自骨架应用的布局部分

        <?php echo $this->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->viewFilesPath('/img/favicon.ico')))
                        ->prependStylesheet($this->viewFilesPath('/css/bootstrap.min.css')) ?>


        <?php echo $this->headScript()
            ->prependFile($this->viewFilesPath() . '/js/bootstrap.min.js')
            ->prependFile($this->viewFilePath() . '/js/jquery.min.js')
        ; ?>

通过Composer安装

步骤

1. 添加到Composer。

    "require" : {
        "andydune/rzn-view-files-path": "dev-master"
    }

2. 如果需要更改基本配置,将配置文件(rzn-view-files-path.global.php)复制到您的应用程序自动加载目录。

3. 将模块添加到应用程序配置(/config/application.config.php)

   ...
   'modules' => array(
        'RznViewFilesPath',
   ),
   ...