This repository has been archived by the owner on May 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add view helper for render a composer.json, and write a new tab in a …
…module page
- Loading branch information
GianArb
committed
Sep 13, 2013
1 parent
eac50fe
commit 7b6bafd
Showing
5 changed files
with
88 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace ZfModule\View\Helper; | ||
|
||
use Zend\View\Helper\AbstractHelper; | ||
use Zend\View\Model\ViewModel; | ||
|
||
class ComposerView extends AbstractHelper | ||
{ | ||
/** | ||
* $var string template used for view | ||
*/ | ||
protected $viewTemplate; | ||
|
||
/** | ||
* __invoke | ||
* | ||
* @access public | ||
* @return string | ||
*/ | ||
public function __invoke($composerConf) | ||
{ | ||
$vm = new ViewModel(array( | ||
'composerConf' => $composerConf, | ||
)); | ||
$vm->setTemplate('zf-module/helper/composer-view.phtml'); | ||
|
||
|
||
return $this->getView()->render($vm); | ||
} | ||
|
||
/** | ||
* @param string $viewTemplate | ||
* @return ZfcUserLoginWidget | ||
*/ | ||
public function setViewTemplate($viewTemplate) | ||
{ | ||
$this->viewTemplate = $viewTemplate; | ||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div class="well">php composer.phar require "<?php echo $this->composerConf['name']?>"</div> | ||
|
||
<h3>Require</h3> | ||
<ul> | ||
<?php foreach($this->composerConf['require'] as $requireName => $requireVersion){ | ||
echo "<li>{$requireName}: <span class='label label-success'>{$requireVersion}</span></li>"; | ||
}?> | ||
</ul> | ||
<?php if(!empty($this->composerConf['require-dev'])){?> | ||
<h3>Require Dev</h3> | ||
|
||
<ul> | ||
<?php foreach($this->composerConf['require-dev'] as $requireName => $requireVersion){ | ||
echo "<li>{$requireName}: <span class='label label-important'>{$requireVersion}</span></li>"; | ||
}?> | ||
</ul> | ||
<?php } ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters