Qiang Xue
12 years ago
16 changed files with 253 additions and 22 deletions
@ -0,0 +1,21 @@
|
||||
<?php |
||||
/** |
||||
* This is the template for generating a controller class within a module. |
||||
* |
||||
* @var yii\base\View $this |
||||
* @var yii\gii\generators\module\Generator $generator |
||||
*/ |
||||
echo "<?php\n";
|
||||
?> |
||||
|
||||
namespace <?php echo $generator->getControllerNamespace(); ?>;
|
||||
|
||||
use yii\web\Controller; |
||||
|
||||
class DefaultController extends Controller |
||||
{ |
||||
public function actionIndex() |
||||
{ |
||||
$this->render('index'); |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
<?php |
||||
/** |
||||
* This is the template for generating a module class file. |
||||
* |
||||
* @var yii\base\View $this |
||||
* @var yii\gii\generators\module\Generator $generator |
||||
*/ |
||||
$className = $generator->moduleClass; |
||||
$pos = strrpos($className, '\\'); |
||||
$ns = ltrim(substr($className, 0, $pos), '\\'); |
||||
$className = substr($className, $pos + 1); |
||||
|
||||
echo "<?php\n";
|
||||
?> |
||||
|
||||
namespace <?php echo $ns; ?> |
||||
|
||||
|
||||
class <?php echo $className; ?> extends \yii\web\Module
|
||||
{ |
||||
public $controllerNamespace = '<?php echo $generator->getControllerNamespace(); ?>';
|
||||
|
||||
public function init() |
||||
{ |
||||
parent::init(); |
||||
|
||||
// custom initialization code goes here |
||||
} |
||||
} |
@ -0,0 +1,18 @@
|
||||
<?php |
||||
/** |
||||
* @var yii\base\View $this |
||||
* @var yii\gii\generators\module\Generator $generator |
||||
*/ |
||||
?> |
||||
<div class="<?php echo $generator->moduleID . '-default-index'; ?>">
|
||||
<h1><?php echo "<?php"; ?> echo $this->context->action->uniqueId; ?></h1>
|
||||
<p> |
||||
This is the view content for action "<?php echo "<?php"; ?> echo $this->context->action->id; ?>".
|
||||
The action belongs to the controller "<?php echo "<?php"; ?> echo get_class($this->context); ?>"
|
||||
in the "<?php echo "<?php"; ?> echo $this->context->module->id; ?>" module.
|
||||
</p> |
||||
<p> |
||||
You may customize this page by editing the following file:<br> |
||||
<code><?php echo "<?php"; ?> echo __FILE__; ?></code>
|
||||
</p> |
||||
</div> |
@ -0,0 +1,13 @@
|
||||
<?php |
||||
/** |
||||
* @var yii\base\View $this |
||||
* @var yii\widgets\ActiveForm $form |
||||
* @var yii\gii\generators\module\Generator $generator |
||||
*/ |
||||
?> |
||||
<div class="module-form"> |
||||
<?php |
||||
echo $form->field($generator, 'moduleClass'); |
||||
echo $form->field($generator, 'moduleID'); |
||||
?> |
||||
</div> |
Loading…
Reference in new issue