Question: |
Good day! Filled website hosting, when you click on the link http://zetalga.testar.testforhost.com/web/site/form2 throws an exception \"PHP Notice – yii\\base\\ErrorExceptionUndefined variable: паме2Сайт on works on open server normally. I`m worn out looking for the cause.Maybe in the server settings need to change something? |
Answer: |
Hello the error says that you have not defined the variable name2 what`s this variable and what should it contain? |
Question: |
This DropDownList is enclosed in a ActiveForm. Contains an array as text. I have them 14. If comment out \"name2\" then writes that is not defined \"name3\" and so on. |
Answer: |
You uploaded all files? You have those undefined variables. Where are they defined? |
Question: |
Yes, everything. In the model(/models) MyForm.php |
Answer: |
In the file only the variable name, and where you define name2, name3, etc. |
Question: |
ie MyForm2.php |
Answer: |
No, in this file you define class variables: $form2->name2, etc. And in your code you use only the definition of $name, use $name and $name2, etc. $name = \"; /* $email = \";*/ } return $this->render(`form2`, [ `form2` => $form2 `name` => $name, `name2` => $name2 `name3` => $name3 `name4` => $name4 You see the difference? |
Answer: |
In your case you need to add in code: { $name = \"; /* $email = \";*/ } to define the variable $name2 and other { $name = \"; $name2 = \"; $name3 = \"; $name4 = \"; $name5 = \"; $name6 = \"; $name7 = \"; $name8 = \"; $name9 = \"; $name10 = \"; $name11 = \"; $name12 = \"; $name13 = \"; $name14 = \"; /* $email = \";*/ } |
Answer: |
Here in this file: /home/zetalga/public_html/controllers/SiteController.php |
Question: |
You are right! Already added. All the rules! Thank you! |
Answer: |
I see that you already corrected the code. Configure the server for you? |
Question: |
Yes... I Agree, to blame :) |
Answer: |
ok |
Question: |
I do not understand, and he then open the server run? |
Answer: |
unfortunately, without the view code to open the server I will not be able to explain it to you. |