Пример #1
0
 public function index()
 {
     $mTest = new TestModel();
     $arrReturn = $mTest->returnArrayTest();
     $arrView = array('arrTest' => $arrReturn);
     return view('test.index', $arrView);
 }
Пример #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //
     $email = Input::get('user_email');
     $pass = $request->input('user_password');
     $login = new TestModel();
     $login->user_email = $email;
     $login->password = Hash::make($pass);
     $login->save();
     return Redirect::to('/login');
 }
Пример #3
0
 /**
  * 定义自己的action
  * @param $id
  * @return null|static
  */
 public function actionMyview($id)
 {
     p($_REQUEST);
     p($_POST);
     p($_GET);
     return TestModel::findOne($id);
 }
Пример #4
0
 public function actionView($id)
 {
     return TestModel::findOne(63)->toArray();
 }
Пример #5
0
echo $form->field($model, 'emails')->widget(\unclead\widgets\MultipleInput::className(), ['limit' => 6, 'allowEmptyList' => false, 'enableGuessTitle' => true, 'min' => 2, 'addButtonPosition' => \unclead\widgets\MultipleInput::POS_HEADER])->label(false);
//echo $form->field($model, 'list')->widget(Select2::classname(), [
//    'data' => \app\models\TestModel::getTestDataList(),
//    'language' => 'de',
//    'options' => ['placeholder' => 'Select a state ...', 'multiple' => true],
//    'pluginOptions' => [
//        'allowClear' => true
//    ],
//]);
?>



    <h3>Multiple columns</h3>
<?php 
echo $form->field($model, 'schedule')->widget(MultipleInput::className(), ['limit' => 4, 'allowEmptyList' => true, 'columns' => [['name' => 'list', 'type' => Select2::className(), 'title' => 'select2', 'options' => ['pluginOptions' => ['allowClear' => true]], 'defaultValue' => '', 'items' => \app\models\TestModel::getTestDataList()], ['name' => 'priority', 'title' => 'Priority', 'defaultValue' => 1, 'enableError' => true, 'options' => ['class' => 'input-priority']], ['name' => 'comment', 'type' => MultipleInputColumn::TYPE_STATIC, 'value' => function ($data) {
    return Html::tag('span', 'static content', ['class' => 'label label-info']);
}, 'headerOptions' => ['style' => 'width: 70px;']], ['type' => MultipleInputColumn::TYPE_CHECKBOX_LIST, 'name' => 'enable', 'headerOptions' => ['style' => 'width: 80px;'], 'items' => [1 => 'Test 1', 2 => 'Test 2', 3 => 'Test 3', 4 => 'Test 4'], 'options' => ['unselect' => 2]]]]);
?>

<?php 
echo Html::submitButton('Update', ['class' => 'btn btn-success']);
ActiveForm::end();
?>


<?php 
$js = <<<JS
        \$('#examplemodel-schedule').on('afterInit', function(){
            console.log('calls on after initialization event');
        }).on('beforeAddRow', function(e) {