controllers/StreetController.php
/**
     * Creates a new Street model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new Street model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Street model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new Street();
        $model_city = new City();
        $my_functions = new MyFunctions();
        $all_cities = $model_city->getAllCities();
        $array_all_cities = $my_functions->myArray($all_cities, 'id', 'city');
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        }
        return $this->render('create', [
            'model' => $model,
            'model_city' => $model_city,
            'array_all_cities' => $array_all_cities,
        ]);
    }
public function actionCreate ( ) { $ model = new Street ( ) ; $ model_city = new City ( ) ; $ my_functions = new MyFunctions ( ) ; $ all_cities = $ model_city -> getAllCities ( ) ; $ array_all_cities = $ my_functions -> myArray ( $ all_cities , 'id' , 'city' ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { return $ this -> redirect ( [ 'view' , 'id' => $ model -> id ] ) ; } return $ this -> render ( 'create' , [ 'model' => $ model , 'model_city' => $ model_city , 'array_all_cities' => $ array_all_cities , ] ) ; }
Creates a new Street model.
Creates a new Street model .