Questions tagged [Yii] (6875)

1
answer

How to add your own error page in Yii2 REST app?

Hello, trying to make a template for developing a REST API in Yii2, took as a basis the advanced template, I want to add all the controllers of the api application (previously created api app(on par with backend, frontend, console)) ContentNegotiator filter, which is formatted to have all the answers in a JSON string, but t...
dannie.Koepp asked April 18th 20 at 13:27
1
answer

How to iterate the result of the AJAX object?

Hi, GET method send via ajax a list of iDisk in the Controller. $.ajax({ url: '/admin/client/remove', data: {ids:JSON.stringify(ids)}, type: 'GET', cache: false, dataType: "json", success: function(res){ console.log(res); }, error: function(res){ console.log(res); } }); I successfully get data in Controller and eve...
Abigale97 asked April 18th 20 at 13:21
1
answer

How to create multi-step queries?

Hello, everyone! The question arose, as in Yii2 to build multi-query, for example $query = Client::find()->where(['like', 'clientName', $q])->andWhere(['responsibleUser' => $someId]); But, for example, if someId is empty and the client does the filtering, as to make sure that all parts gathered (using if else, che...
Wilma96 asked April 18th 20 at 13:13
1
answer

How to properly and safely use the ORM in Yii 2?

Hello. The background Who knows what ORM, and especially, who used it, and know that this thing is very comfortable. I was looking for, is there any ORM in Yii 2, and found there the Doctrine - ( installed with Yii ) and class Migration You say, open a console and type yii migrate and you will have happiness. Yes! When you...
madilyn.Bo asked April 18th 20 at 13:04
1
answer

How to place a block in yii2 link?

I have a link and how to put inside the block? as in normal links tags close themselves, and then don't understand <?= Html::a("), ['news','source'=>$new->source] ['class'=>"])?> just like there is a block inside links together the usual link to link to put yii2 <a class="" href="/news/news?source=<?=...
Foster10 asked April 18th 20 at 12:59
1
answer

How to get the application settings?

in web.php are the params correct ? where included file params.php there I added my desired line. <?php return [ 'adminEmail' => 'admin@example.com', 'senderEmail' => 'noreply@example.com', 'senderName' => 'Example.com mailer', 'token' => '1231hu23139dj203dsidfj3u4fsdofijs', // this ]; Then in the cont...
moriah.Berni asked April 18th 20 at 12:57
0
answer

How to create a page in YII2?

Created a controller Cart class CartController extends PublicController { public static function getRules($type = false) { return [ '/cart' => 'cart/index', ]; } public static $uniqId = 'cart'; public static $controllerTitle = 'Basket'; public static $all = false; public function actionIndex() { return $this-&...
braxton28 asked April 18th 20 at 12:56
0
answer

How to configure authorization in yii2?

The essence of the question is, has anyone done their authorization and the check to the table was not auth_key, password_hash, together they were just password and without encryption. Do you have somebody such projects can share the files?? I would like to study how the configured validation. PS: don't know where it is po...
janelle.Rodriguez asked April 18th 20 at 12:36
1
answer

How to set your signup in yii2?

I write your code for login and registration in Yii 2, with the input I have everything works fine, I used through the admin panel of people added, right now, it was necessary to make the registration open, and if registration in the database are added but do not get validation to do or how it is called, after adding to the...
rory.Jones asked April 18th 20 at 12:34
1
answer

How to make validation in yii2 and type hint's in php7?

Faced in the project (rest API) on yii2 with an interesting situation. There is a model (unasledovala from the Model), the model paleopedology methods setters, these methods are written with a type hint. The model is supposed to validate the data, ie what arrives with the request. Now send a request with invalid parameters...
reanna.Nikolaus asked April 18th 20 at 12:22