Yii Framework $ this-& gt; render (index, & nbsp; array (list & nbsp; & gt; & nbsp; $ list? Thank you very much for your help ~ Share To: yii Framework
$ This-> render ('index', array ('list' => $ list ));
What does that mean?
Thank you very much for your help ~
Share: More
------ Solution --------------------
$ This-> render ('index', array ('list' => $ list ));
Index refers to the view.
Array ('list' => $ list) is to name $ list as a list variable or array and upload it to the index View.
------ Solution --------------------
Display the index. php page and pass the value $ list. The difference is that renderPartial is only used to render the partial view. Join hands with beginners like you
------ Solution --------------------
In my understanding, the rendering index template transmits the value $ list to the index. if there are more values, you can pass it as an element of the array, such
$ This-> render ('index', array ('list' => $ list, 'name' => $ arr_names ));
------ Solution --------------------
Reference:
In my understanding, the rendering index template transmits the value $ list to the index. if there are more values, you can pass it as an element of the array, such
$ This-> render ('index', array ('list' => $ list, 'name' => $ arr_names ));
Upload the array variable $ list and $ name to the index template.
------ Solution --------------------
It seems that Yii Framework users are still very active.
------ Solution --------------------
Input the list parameter to the index View. you can directly use the $ list variable in the index and render the output at the same time.
------ Solution --------------------
Render calls layout to render a view and display it.
Another renderPrtial directly displays a view without calling layout.
You can try it.
------ Solution --------------------
There are two values in the brackets, the first is your view page, the second array is the value to be passed, the key is the value you pass to the page, and the value is the value you get in the controller,