Most voted "yii2" questions
Use this tag if your question is related to the PHP Yii2 framework.
Learn more…21 questions
Sort by count of
-
2
votes2
answers347
viewsCalling a controller action for views
I’m using Yii2 and doing a website project where one of the features is to list the movies linked to a specific user. I already have a method to associate movies to accounts and one that makes the…
-
1
votes3
answers1130
viewsHow to format a php array
I’m doing an SQL query in my model and in the controller, I’m printing the values of array. The exhibition is like this: Array ( [campo1] => 98 [campo2] => SOLO [soma] => 1 ) Array (…
-
1
votes1
answer104
viewsDual dropdown dependent on Yii2
How can I resolve this implementation below, so it performs the 2 dependency routines associated with the same onChange event: Example: <?php echo $form->field($model, 'id_data_type', […
-
0
votes0
answers478
viewsYII2 Modal Ajax
good morning ! I am somewhat new in terms of programming, even more so in Yii2, and I know there are some guides on how to use Ajax in Yii2, but they are few and I still can’t understand easily,…
-
0
votes1
answer138
viewsHow to pass a variable into a php callback with Yii2
I am trying to make a somewhat abstract method that will execute a yii2 query depending on the attribute passed my code is: public static function getModelosQuePodemTer($atributo) { self::$helper =…
-
0
votes1
answer95
viewsReturn of a Stored Procedure
I have an X-Action on my app that when performing it, a stored Procedure in the bank that generates a insert in a table. So far quiet. What I need is a way that when this stored Procedure is…
-
0
votes1
answer40
viewsSearching for existence of registration before including a new one (Yii 2)
Olá Pessoal! In the create.php of a view (ANOLETIVO), I do the search if there is record in the table with status = 1. If it exists the new inclusion should not be allowed. I’ve done it in the Yii 1…
yii2asked 6 years, 9 months ago Álvaro Souza 1 -
0
votes1
answer199
viewsUpdate with two Yii2 models
I am studying about Yii2 and do not have much knowledge of the framework. I’m having difficulty updating data in the database that are in two different models (Student and Address). The idea is…
-
0
votes1
answer32
viewsSerial ID not assigning to model id
I’m making a website that receives for a Webservice, data from a dvd (from a site of another colleague), and creates an offer with his information. I think I’m having trouble with the MVC…
-
0
votes1
answer29
viewsCodeception see() method with Yii2 does not display all page content
Hello! I am testing a PHP(7.2.1) system that uses the Yii2 framework, and for that, by default I am using codeception. When writing functional tests, several methods are not working as expected.…
-
0
votes0
answers53
viewsHow to store </br> and n in the database, and then show in HTML when it is called?
I’m storing it in the attribute off_desc the description of an offer, but even if in Textarea I insert line breaks, in the database and in HTML (When I try to collect the data), they are all shown…
-
0
votes1
answer76
viewsLoad a json into a Yii2 Dropdownlist
I recently migrated to the YII 2 framework. And I have a small question: I have a json that I need to popular a Dropdownlist. The Json file: [ {"codigo": "05", "descricao" : "Administrador"},…
-
0
votes2
answers106
viewsRemove Div in which element is included
I have a form, where I do the clone (jQuery) to add new inputs, where I can also remove them. The problem that occurs is: I need to remove the div "chain" where the remove button is. And currently I…
-
0
votes1
answer746
viewsSQLSTATE[HY000]: General error: 1 no such table: when running Migration on SQLITE with Yii2
I am using yii2 for a small project, I am using sqlite to persist the data. And here is where the problem is occurring. Any table I create in sqlite yii2 does not recognize, nor does using GII to…
-
0
votes1
answer105
viewsYii2 - How to sort gridview in a form [POST] without losing the filters using Windows arrayDataProvider
I have a form with 14 search fields and half of these fields are arrays, for this reason the form method is POST otherwise shows error (414 - Request URI Too long). I’m using the gridview to render…
-
0
votes1
answer49
viewsQuery in YII 2 getting a different result from the Where clause
I’m conducting a consultation, where it contains a clause Where where the flag Status is to be applied during implementation. But the result always comes, ignoring my clause.…
-
0
votes1
answer39
viewsDuplicate fields with Yii2 Multipleinput
I have a form that will need duplicity. It is an academic form. In this form, it contains the following attributes, according to my model: class Academico extends \app\models\MainModel { /** *…
-
0
votes1
answer67
viewsGenerating zip file receiving file input
I have to generate the zip via an upload via file input, get compressed if not compressed and get it ready for download. It is working, the problem is that if the file sent is zip it compresses…
-
0
votes1
answer28
viewsYii2 Call to a Member Function getRoute()
I had to make a page using Yii2 at work and at first everything went well, I tested via Postman and the paging works right. $pagination = new Pagination(['totalCount' =>…
-
-1
votes1
answer263
viewsput a div inside a function in php
I have this command that checks the database and checks if the user is locked, in case it shows an error message, if it is not locked it continues the normal execution. What I’m wanting is when it…
-
-1
votes1
answer42
viewsView path cannot be displayed in Yii
Good afternoon. I am learning the development of the YII PHP framework I’m following a tutorial, in which the person shows how to create the route and how to create it. I created my controller…