Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $form = ActiveForm::begin(); ?>
- <?= $form->field($model, 'name')->label('Имя') ?>
- <?= $form->field($model, 'category')->label('Категория') ?>
- <?= Html::submitButton('Отправить', ['class' => 'btn btn-primary']) ?>
- <?php ActiveForm::end(); ?>
- namespace appmodels;
- use yiidbActiveRecord;
- class Products extends ActiveRecord
- {
- public $name;
- public $category;
- public static function tableName()
- {
- return 'products';
- }
- }
- $model = new Products();
- if ($model->load(Yii::$app->request->post()))
- $model->save();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement