|
|||
|
OK, so I can gather from what I have read that 'render' basically prints something and redirect sends you to another location, but are there any other differences?
Does 'render' stop the execution of a method it is within or does it continue to run after the render has been called? I have a form that i want to validate and retain the values if it fails, would render be the best choice? What happens to the rest of the checks in the same function? ex; function checkSubmittedVals() { if ($a != $b) { $this->render('form'); } echo 'hello!'; if ($form->isValid()) { echo 'processing'; } } If the $a != $b fails, does 'hello!' get printed? |
|
|||
|
The method render() does not stop the execution of the script.
I'm not sure what you are asking exactly about render() and _redirect(). I don't see the relationship between these two methods that you do. I personally reserve render() for use within view scripts. The logic that defines the value of the paramter passed to render() resides in my controllers, so that by the time render() gets it it is only going to be valid content. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|