public function actionAdd()
 {
     $this->adminOnly();
     $model = new AddPageForm();
     $model->availableTypes = ContainerPage::getPageTypes();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         return $this->redirect($this->contentContainer->createUrl('edit', ['type' => $model->type]));
     }
     return $this->render('add', ['model' => $model]);
 }
コード例 #2
0
?>
</div>
    <div class="panel-body">

        <?php 
echo Html::a(Yii::t('CustomPagesModule.base', 'Create new Page'), $container->createUrl('add'), array('class' => 'btn btn-primary'));
?>

        <p />
        <p />

        <?php 
if (count($pages) != 0) {
    ?>
            <?php 
    $types = ContainerPage::getPageTypes();
    ?>
            <table class="table">
                <tr>
                    <th><?php 
    echo Yii::t('CustomPagesModule.base', 'Title');
    ?>
</th>
                    <th><?php 
    echo Yii::t('CustomPagesModule.base', 'Type');
    ?>
</th>
                    <th><?php 
    echo Yii::t('CustomPagesModule.base', 'Sort Order');
    ?>
</th>