Created
February 9, 2015 21:51
-
-
Save schmunk42/d3f3c2a5fb3d4d55b06e to your computer and use it in GitHub Desktop.
Yii2 module default view, showing all controllers in module (requires dmstr/yii2-application metadata)
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
<?php | |
use yii\helpers\Inflector; | |
?> | |
<div class="crud-default-index"> | |
<h1><?= $this->context->action->uniqueId ?></h1> | |
<div class="box"> | |
<div class="box-header"> | |
<h3 class="box-title">Module Controllers</h3> | |
</div> | |
<div class="box-body"> | |
<?php | |
foreach (\Yii::$app->getModule('admin')->getControllers($this->context->module->id) AS $i => $controller) { | |
echo yii\helpers\Html::a( | |
Inflector::camel2words(Inflector::id2camel($controller)), | |
["/{$this->context->module->id}/$controller"], | |
['class' => 'col-sm-3 btn btn-lg btn-default btn-flat'] | |
); | |
} | |
?> | |
<div class="clearfix"></div> | |
</div> | |
<!-- /.box-body --> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment