module.php 618 Bytes
Newer Older
1 2 3 4
<?php
/**
 * This is the template for generating a module class file.
 */
5 6 7 8

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\module\Generator */

9 10 11 12 13 14 15 16
$className = $generator->moduleClass;
$pos = strrpos($className, '\\');
$ns = ltrim(substr($className, 0, $pos), '\\');
$className = substr($className, $pos + 1);

echo "<?php\n";
?>

Alexander Makarov committed
17
namespace <?= $ns ?>;
18

Alexander Makarov committed
19
class <?= $className ?> extends \yii\base\Module
20
{
21
    public $controllerNamespace = '<?= $generator->getControllerNamespace() ?>';
22

23 24 25
    public function init()
    {
        parent::init();
26

27 28
        // custom initialization code goes here
    }
29
}