Yii
- 10 ответов
- 0 вопросов
4
Вклад в тег
<?= $form->field($model, 'username', [
'inputOptions' => ['class' => 'custom-class']
]); ?>
use yii\grid\GridView;
$userProvider->pagination->pageParam = 'user-page';
$userProvider->sort->sortParam = 'user-sort';
$postProvider->pagination->pageParam = 'post-page';
$postProvider->sort->sortParam = 'post-sort';
echo '<h1>Users</h1>';
echo GridView::widget([
'dataProvider' => $userProvider,
]);
echo '<h1>Posts</h1>';
echo GridView::widget([
'dataProvider' => $postProvider,
]);
public function rules()
public function relations ()
array('attribute list', 'validator name', 'on'=>'scenario name', ...validation parameters...)
attribute list: specifies the attributes (separated by commas) to be validated;
array('test, configsArray' ,'safe'),