Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Commit

Permalink
moved view logic to view
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Rieger committed Jan 16, 2015
1 parent 131e906 commit 15f3631
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
6 changes: 0 additions & 6 deletions module/ZfModule/src/ZfModule/Controller/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,9 @@ public function viewAction()
}

$repository = $this->repositoryRetriever->getUserRepositoryMetadata($vendor, $module);

$readme = $this->repositoryRetriever->getRepositoryFileContent($vendor, $module, 'README.md');
$readme = !$readme ? 'No README file found for this Module' : $readme;

$license = $this->repositoryRetriever->getRepositoryFileContent($vendor, $module, 'LICENSE');
$license = !$license ? 'No license file found for this Module' : $license;

$composerConf = $this->repositoryRetriever->getRepositoryFileContent($vendor, $module, 'composer.json');
$composerConf = !$composerConf ? 'No composer.json file found for this Module' : $composerConf;

$viewModel = new ViewModel(array(
'vendor' => $vendor,
Expand Down
24 changes: 19 additions & 5 deletions module/ZfModule/view/zf-module/index/view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,31 @@

<div class="tab-content">
<div class="tab-pane active" id="readme">
<?php echo $this->markdown($this->readme); ?>
<?php if($readme): ?>
<?php echo $this->markdown($this->readme); ?>
<?php else: ?>
No README file found for this Module
<?php endif; ?>
</div>
<!--<div class="tab-pane" id="composer">
<?php if (is_array($composerConf)): ?>
<?php echo $this->composerView($this->composerConf); ?>
<?php if($this->composerConf): ?>
<?php if (is_array($composerConf)): ?>
<?php echo $this->composerView($this->composerConf); ?>
<?php else: ?>
<?php echo $this->composerConf; ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->composerConf; ?>
No composer.json file found for this Module
<?php endif; ?>
</div>-->
<div class="tab-pane" id="license">
<pre><?php echo $license; ?></pre>
<pre>
<?php if($readme): ?>
<?php echo $license; ?>
<?php else: ?>
No license file found for this Module
<?php endif; ?>
</pre>
</div>
</div>
</div>
Expand Down

0 comments on commit 15f3631

Please sign in to comment.