承接 radnan/rdn-asset 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

radnan/rdn-asset

Composer 安装命令:

composer require radnan/rdn-asset

包简介

Zend Framework 2 simple asset publishing module

README 文档

README

The RdnAsset ZF2 module provides a very simple way to publish the public assets for all your modules.

How to install

  1. Use composer to require the radnan/rdn-asset package:

    $ composer require radnan/rdn-asset:1.*
  2. Activate the module by including it in your application.config.php file:

    <?php
    
    return array(
        'modules' => array(
            'RdnAsset',
            // ...
        ),
    );

How to use

Create a public/ directory in your module's root and place all your public assets there. Then, simply run the following command from your project root:

$ vendor/bin/console asset:publish

This will publish the module's assets to your project root's public/modules/ directory.

Now, you can include assets from this module by using the path /modules/<module-name>/<asset-name>. For example, in your view file you could do the following:

<?php $this->headLink()
	->appendStylesheet($this->basePath('/modules/rdn-asset/css/foo.css')) ?>

Asset source

By default, we assume assets are located in the <module-root>/public/ directory. If this is not true for a module, you can implement the getPublicPath() method on it which should return the actual path to its assets:

namespace App;

class Module
{
	public function getPublicPath()
	{
		return 'module/app/public-foo';
	}
}

Publish path

Assets are published to the <project-root>/public/modules/ directory. By default, the Symlink adapter is used to publish the assets. Assets are grouped by their module name and the module name is converted into dash-case to follow the standard asset naming conventions.

You can change this publish path by using the following configuration:

<?php

return array(
	'rdn_asset' => array(
		'target_path' => 'public/modules-foo',
	),
);

Asset cleanup

You can remove assets that no longer exist by using the --prune option:

$ vendor/bin/console asset:publish --prune

统计信息

  • 总下载量: 26
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固