Download the PHP package websafe/lib-view-helper-git-repository without Composer
On this page you can find all versions of the php package websafe/lib-view-helper-git-repository. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download websafe/lib-view-helper-git-repository
More information about websafe/lib-view-helper-git-repository
Files in websafe/lib-view-helper-git-repository
Package lib-view-helper-git-repository
Short Description A library of ZF2 View Helpers for retrieving information about current application's local Git repository.
License BSD-3-Clause
Homepage http://github.com/websafe/lib-view-helper-git-repository/
Informations about the package lib-view-helper-git-repository
Websafe\View\Helper\Git\Repository
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></h1>
Result:
<h1>master</h1>
Websafe\View\Helper\Git\Repository\Description
<p><p>
Result:
<p>Unnamed repository; edit this file 'description' to name the repository.</p>