websafe/lib-view-helper-git-repository
Composer 安装命令:
composer require websafe/lib-view-helper-git-repository
包简介
A library of ZF2 View Helpers for retrieving information about current application's local Git repository.
关键字:
README 文档
README
A library of ZF2 - View Helpers for retrieving information about current application's local Git repository.
Quickstart
Add this package to your Composer based application
Add this package to composer.json and install in vendor/ by running:
composer require \
websafe/lib-view-helper-git-repository:0.1.*
or
php vendor/bin/composer.phar require \
websafe/lib-view-helper-git-repository:0.1.*
Enable provided view helpers in your ZF2 application
To enable the provided view helpers in your application - copy the file
websafe.view.helper.git.repository.global.php.dist found in
vendor/websafe/lib-view-helper-git-repository/config/, to
config/autoload/websafe.view.helper.git.repository.global.php.
The copied file declares the required invokables for the provided view helpers in your ZF2 application.
return array( 'view_helpers' => array( 'invokables' => array( 'gitRepoCurrentBranch' => 'Websafe\View\Helper\Git\Repository\CurrentBranch', 'gitRepoDescription' => 'Websafe\View\Helper\Git\Repository\Description', ), ), );
Use provided view helpers in your view scripts
Websafe\View\Helper\Git\Repository\CurrentBranch
<h1><?php echo $this->gitRepoCurrentBranch();?></h1>
Result:
<h1>master</h1>
Websafe\View\Helper\Git\Repository\Description
<p><?php echo $this->gitRepoDescription();?><p>
Result:
<p>Unnamed repository; edit this file 'description' to name the repository.</p>
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-03-05