コード例 #1
0
 /**
  * Initializes the default button rendering callbacks.
  */
 protected function initDefaultButtons()
 {
     if (!isset($this->buttons['view'])) {
         $this->buttons['view'] = function ($url, $model, $key) {
             $options = array_merge(['title' => Yii::t('yii', 'View'), 'aria-label' => Yii::t('yii', 'View'), 'data-pjax' => '0'], $this->buttonOptions);
             return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, $options);
         };
     }
     if (!isset($this->buttons['update'])) {
         $this->buttons['update'] = function ($url, $model, $key) {
             $options = array_merge(['title' => Yii::t('yii', 'Update'), 'aria-label' => Yii::t('yii', 'Update'), 'data-pjax' => '0'], $this->buttonOptions);
             return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, $options);
         };
     }
     if (!isset($this->buttons['delete'])) {
         $this->buttons['delete'] = function ($url, $model, $key) {
             $options = array_merge(['title' => Yii::t('yii', 'Delete'), 'aria-label' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0'], $this->buttonOptions);
             return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, $options);
         };
     }
 }
コード例 #2
0
ファイル: view.php プロジェクト: romdim/dbi-playground
  <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . 'List All' . ' Tiles Users', ['tiles-users/index'], ['class' => 'btn text-muted btn-xs']);
?>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' Tiles User', ['tiles-users/create', 'TilesUser' => ['tile' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-TilesUsers', 'enableReplaceState' => false, 'linkSelector' => '#pjax-TilesUsers ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getTilesUsers(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-tilesusers']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'tiles-users' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'tiles-users'], ['class' => yii\grid\DataColumn::className(), 'attribute' => 'level', 'value' => function ($model) {
    if ($rel = $model->getLevel()->one()) {
        return Html::a($rel->id, ['levels/view', 'id' => $rel->id], ['data-pjax' => 0]);
    } else {
        return '';
    }
}, 'format' => 'raw'], 'created_at', 'updated_at', 'created_by', 'updated_by']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['common\\models\\Tiles'], 'active' => true], ['content' => $this->blocks['TilesUsers'], 'label' => '<small>Tiles Users <span class="badge badge-default">' . count($model->getTilesUsers()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
        </div>
    </div>
</div>
コード例 #3
0
ファイル: view.php プロジェクト: alexus007/budget
    <!-- menu buttons -->
    <p class='pull-left'>
        <?php 
echo Html::a('<span class="glyphicon glyphicon-pencil"></span> ' . Yii::t('app', 'Edit'), ['update', 'id' => $model->id], ['class' => 'btn btn-info btn-xs']);
?>
        <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'New'), ['create'], ['class' => 'btn btn-success btn-xs']);
?>
        <?php 
echo Html::a('<span class="glyphicon glyphicon-trash"></span> ' . Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger btn-xs', 'style' => 'nowrap', 'data-confirm' => '' . Yii::t('app', 'Are you sure to delete this item?') . '', 'data-method' => 'post']);
?>
    </p>
    <p class="pull-right">
        <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . Yii::t('app', 'List Budgets'), ['index'], ['class' => 'btn btn-default btn-xs']);
?>
    </p>

    <div class="clearfix"></div>

    <!-- flash message -->
    <?php 
if (\Yii::$app->session->getFlash('deleteError') !== null) {
    ?>
        <span class="alert alert-info alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span></button>
            <?php 
    echo \Yii::$app->session->getFlash('deleteError');
    ?>
コード例 #4
0
ファイル: view.php プロジェクト: aixiaobenaixiaoben/find
        </div>

    </div>


    <?php 
$this->beginBlock('common\\models\\location\\LocationCurrent');
?>

    
    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['format' => 'html', 'attribute' => 'user_id', 'value' => $model->getUser()->one() ? Html::a($model->getUser()->one()->id, ['user/view', 'id' => $model->getUser()->one()->id]) : '<span class="label label-warning">?</span>'], ['format' => 'html', 'attribute' => 'event_id', 'value' => $model->getEvent()->one() ? Html::a($model->getEvent()->one()->id, ['event/view', 'id' => $model->getEvent()->one()->id]) : '<span class="label label-warning">?</span>'], 'is_origin', 'title', 'latitude', 'longitude', 'occur_at', 'created_at']]);
?>

    
    <hr/>

    <?php 
echo Html::a('<span class="glyphicon glyphicon-trash"></span> ' . 'Delete', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data-confirm' => '' . 'Are you sure to delete this item?' . '', 'data-method' => 'post']);
?>
    <?php 
$this->endBlock();
?>


    
    <?php 
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['common\\models\\location\\LocationCurrent'], 'active' => true]]]);
?>
</div>
コード例 #5
0
ファイル: view.php プロジェクト: romdim/dbi-playground
?>
    <?php 
$this->endBlock();
?>


    
<?php 
$this->beginBlock('Tiles');
?>
<div style='position: relative'><div style='position:absolute; right: 0px; top 0px;'>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . 'List All' . ' Tiles', ['tiles/index'], ['class' => 'btn text-muted btn-xs']);
?>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' Tile', ['tiles/create', 'Tile' => ['category' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-Tiles', 'enableReplaceState' => false, 'linkSelector' => '#pjax-Tiles ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getTiles(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-tiles']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'tiles' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'tiles'], 'id', 'name', 'description', 'text:ntext', 'created_at', 'updated_at', 'created_by', 'updated_by']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
コード例 #6
0
ファイル: view.php プロジェクト: romdim/dbi-playground
</div></div><?php 
Pjax::begin(['id' => 'pjax-Parts', 'enableReplaceState' => false, 'linkSelector' => '#pjax-Parts ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getParts(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-parts']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'parts' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'parts'], 'id', 'name', 'created_at', 'updated_at', ['class' => yii\grid\DataColumn::className(), 'attribute' => 'created_by', 'value' => function ($model) {
    if ($rel = $model->getCreatedBy()->one()) {
        return Html::a($rel->id, ['user/view', 'id' => $rel->id], ['data-pjax' => 0]);
    } else {
        return '';
    }
}, 'format' => 'raw'], ['class' => yii\grid\DataColumn::className(), 'attribute' => 'updated_by', 'value' => function ($model) {
    if ($rel = $model->getUpdatedBy()->one()) {
        return Html::a($rel->id, ['user/view', 'id' => $rel->id], ['data-pjax' => 0]);
    } else {
        return '';
    }
}, 'format' => 'raw']]]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['common\\models\\Steps'], 'active' => true], ['content' => $this->blocks['Parts'], 'label' => '<small>Parts <span class="badge badge-default">' . count($model->getParts()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
        </div>
    </div>
</div>
コード例 #7
0
ファイル: view.php プロジェクト: harryandriyan/simkos
  <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . 'List All' . ' Role Menuses', ['role-menu/index'], ['class' => 'btn text-muted btn-xs']);
?>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' Role Menus', ['role-menu/create', 'RoleMenus' => ['menu_id' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-RoleMenuses', 'enableReplaceState' => false, 'linkSelector' => '#pjax-RoleMenuses ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getRoleMenuses(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-rolemenuses']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'role-menu' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'role-menu'], 'id', ['class' => yii\grid\DataColumn::className(), 'attribute' => 'role_id', 'value' => function ($model) {
    if ($rel = $model->getRole()->one()) {
        return Html::a($rel->name, ['role/view', 'id' => $rel->id], ['data-pjax' => 0]);
    } else {
        return '';
    }
}, 'format' => 'raw']]]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['app\\models\\Menu'], 'active' => true], ['content' => $this->blocks['Menuses'], 'label' => '<small>Menuses <span class="badge badge-default">' . count($model->getMenuses()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['RoleMenuses'], 'label' => '<small>Role Menuses <span class="badge badge-default">' . count($model->getRoleMenuses()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
        </div>
    </div>
</div>
コード例 #8
0
<div class="row">
    <div class="col-lg-8">
        <div class="panel panel-default">
            <div class="panel-body">
                <div class="employee-assign-form">
                    <?php 
$form = ActiveForm::begin(['layout' => 'horizontal', 'enableClientValidation' => true, 'errorSummaryCssClass' => 'error-summary alert alert-error']);
?>

                    <?php 
echo $form->field($model, 'roleName')->radioList($model->allRoles);
?>

                    <hr/>
                    <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . Yii::t('app', 'Save'), ['id' => 'save-' . $model->formName(), 'class' => 'btn btn-success']);
?>

                    <?php 
ActiveForm::end();
?>


                </div>

            </div>

        </div>
    </div>
</div>
コード例 #9
0
ファイル: view.php プロジェクト: romdim/dbi-playground
  <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . 'List All' . ' Password Answers', ['password-answers/index'], ['class' => 'btn text-muted btn-xs']);
?>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' Password Answer', ['password-answers/create', 'PasswordAnswer' => ['answer' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-PasswordAnswers', 'enableReplaceState' => false, 'linkSelector' => '#pjax-PasswordAnswers ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getPasswordAnswers(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-passwordanswers']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'password-answers' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'password-answers'], ['class' => yii\grid\DataColumn::className(), 'attribute' => 'password', 'value' => function ($model) {
    if ($rel = $model->getPassword()->one()) {
        return Html::a($rel->id, ['passwords/view', 'id' => $rel->id], ['data-pjax' => 0]);
    } else {
        return '';
    }
}, 'format' => 'raw'], 'created_at', 'updated_at']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['app\\models\\Answers'], 'active' => true], ['content' => $this->blocks['PasswordAnswers'], 'label' => '<small>Password Answers <span class="badge badge-default">' . count($model->getPasswordAnswers()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
        </div>
    </div>
</div>
コード例 #10
0
ファイル: view.php プロジェクト: ICHydro/anaconda
?>
    <?php 
$this->endBlock();
?>


    
<?php 
$this->beginBlock('Sensors');
?>
<div style='position: relative'><div style='position:absolute; right: 0px; top: 0px;'>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . Yii::t('app', 'List All') . ' Sensors', ['sensor/index'], ['class' => 'btn text-muted btn-xs']);
?>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'New') . ' Sensor', ['sensor/create', 'Sensor' => ['catchmentid' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-Sensors', 'enableReplaceState' => false, 'linkSelector' => '#pjax-Sensors ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getSensors(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-sensors']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => Yii::t('app', 'First'), 'lastPageLabel' => Yii::t('app', 'Last')], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'sensor' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'sensor'], 'id', 'name', 'latitude', 'longitude', 'sensortype', 'units', 'height', 'width', 'angle']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
コード例 #11
0
ファイル: view.php プロジェクト: romdim/dbi-playground
    }
}, 'format' => 'raw'], 'created_at', 'updated_at', 'created_by', 'updated_by']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


<?php 
$this->beginBlock('Results');
?>
<div style='position: relative'><div style='position:absolute; right: 0px; top 0px;'>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . 'List All' . ' Results', ['results/index'], ['class' => 'btn text-muted btn-xs']);
?>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' Result', ['results/create', 'Result' => ['results_page' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-Results', 'enableReplaceState' => false, 'linkSelector' => '#pjax-Results ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getResults(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-results']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'results' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'results'], 'id', 'name', 'description:ntext', 'text:ntext', 'small_photo', 'big_photo', 'created_at', 'updated_at', 'created_by']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
コード例 #12
0
ファイル: view.php プロジェクト: febfeb/yii2-basic-ready
    }
}, 'format' => 'raw']]]) . '</div>';
Pjax::end();
$this->endBlock();
?>


<?php 
$this->beginBlock('Users');
?>
<div style='position: relative'><div style='position:absolute; right: 0px; top 0px;'>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . 'List All' . ' Users', ['user/index'], ['class' => 'btn text-muted btn-xs']);
?>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' User', ['user/create', 'User' => ['role_id' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-Users', 'enableReplaceState' => false, 'linkSelector' => '#pjax-Users ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getUsers(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-users']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'user' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'user'], 'id', 'username', 'password', 'name', 'photo_url:url', 'last_login', 'last_logout']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
コード例 #13
0
ファイル: view.php プロジェクト: romdim/dbi-playground
  <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . 'List All' . ' Password Answers', ['password-answers/index'], ['class' => 'btn text-muted btn-xs']);
?>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' Password Answer', ['password-answers/create', 'PasswordAnswer' => ['password' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-PasswordAnswers', 'enableReplaceState' => false, 'linkSelector' => '#pjax-PasswordAnswers ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getPasswordAnswers(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-passwordanswers']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'password-answers' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'password-answers'], ['class' => yii\grid\DataColumn::className(), 'attribute' => 'answer', 'value' => function ($model) {
    if ($rel = $model->getAnswer()->one()) {
        return Html::a($rel->id, ['answers/view', 'id' => $rel->id], ['data-pjax' => 0]);
    } else {
        return '';
    }
}, 'format' => 'raw'], 'created_at', 'updated_at']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['app\\models\\Passwords'], 'active' => true], ['content' => $this->blocks['PasswordAnswers'], 'label' => '<small>Password Answers <span class="badge badge-default">' . count($model->getPasswordAnswers()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
        </div>
    </div>
</div>
コード例 #14
0
ファイル: view.php プロジェクト: febfeb/yii2-dynamic-field
    <div class="clearfix"></div>

    <div class="panel panel-default">
        <div class="panel-body">
            <?php 
if (isset($dataProvider)) {
    $column = [['class' => 'yii\\grid\\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) {
        // using the column name as key, not mapping to 'id' like the standard generator
        $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
        $params[0] = \Yii::$app->controller->id ? \Yii::$app->controller->id . '/' . $action : $action;
        return Url::toRoute($params);
    }, 'contentOptions' => ['nowrap' => 'nowrap', 'style' => 'text-align:center']]];
    /* @var $searchModel \app\models\search\CobaBroh */
    foreach ($searchModel->attributes() as $attribute) {
        \app\components\NodeLogger::sendLog($attribute);
        $column[] = $attribute;
    }
    ?>
            <?php 
    echo GridView::widget(['layout' => '{summary}{pager}{items}{pager}', 'dataProvider' => $dataProvider, 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'filterModel' => $searchModel, 'tableOptions' => ['class' => 'table table-striped table-bordered table-hover'], 'headerRowOptions' => ['class' => 'x'], 'columns' => $column]);
    ?>
            <?php 
} else {
    echo "Please Generate Model First or Click Here : <br>" . Html::a("<i class='fa fa-check'></i> Generate Model", ["table/generate", "id" => $model->id], ["class" => "btn btn-info"]);
}
?>
        </div>
    </div>
</div>
コード例 #15
0
ファイル: view.php プロジェクト: aixiaobenaixiaoben/find
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-LocationNews', 'enableReplaceState' => false, 'linkSelector' => '#pjax-LocationNews ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getLocationNews(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-locationnews']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'location-new' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'location-new'], 'id', ['class' => yii\grid\DataColumn::className(), 'attribute' => 'event_id', 'value' => function ($model) {
    if ($rel = $model->getEvent()->one()) {
        return Html::a($rel->id, ['event/view', 'id' => $rel->id], ['data-pjax' => 0]);
    } else {
        return '';
    }
}, 'format' => 'raw'], ['class' => yii\grid\DataColumn::className(), 'attribute' => 'provider_id', 'value' => function ($model) {
    if ($rel = $model->getProvider()->one()) {
        return Html::a($rel->id, ['location-provider/view', 'id' => $rel->id], ['data-pjax' => 0]);
    } else {
        return '';
    }
}, 'format' => 'raw'], 'title_from_provider', 'title_from_API', 'latitude', 'longitude', 'is_reliable', 'occur_at']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php 
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['common\\models\\User'], 'active' => true], ['content' => $this->blocks['Events'], 'label' => '<small>Events <span class="badge badge-default">' . count($model->getEvents()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['LocationCurrents'], 'label' => '<small>Location Currents <span class="badge badge-default">' . count($model->getLocationCurrents()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['LocationNews'], 'label' => '<small>Location News <span class="badge badge-default">' . count($model->getLocationNews()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
</div>
コード例 #16
0
ファイル: view.php プロジェクト: ICHydro/anaconda
    return $params;
}, 'buttons' => [], 'controller' => 'calibration'], 'id', 'datetime', 'height', 'measure', 'yourname', 'youremail:email']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


<?php 
$this->beginBlock('Files');
?>
<div style='position: relative'><div style='position:absolute; right: 0px; top: 0px;'>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . Yii::t('app', 'List All') . ' Files', ['file/index'], ['class' => 'btn text-muted btn-xs']);
?>
  <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'New') . ' File', ['file/create', 'File' => ['sensorid' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php 
Pjax::begin(['id' => 'pjax-Files', 'enableReplaceState' => false, 'linkSelector' => '#pjax-Files ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getFiles(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-files']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => Yii::t('app', 'First'), 'lastPageLabel' => Yii::t('app', 'Last')], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
    // using the column name as key, not mapping to 'id' like the standard generator
    $params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
    $params[0] = 'file' . '/' . $action;
    return $params;
}, 'buttons' => [], 'controller' => 'file'], 'id', 'filelink', 'filename', 'extension', 'startdate', 'enddate', 'status']]) . '</div>';
Pjax::end();
$this->endBlock();
?>


    <?php