Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-2008, 08:54 PM
Junior Member
 
Join Date: Jun 2008
Location: earth
Posts: 14
Default render or redirect; what's the difference

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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-24-2008, 09:01 PM
Member
 
Join Date: Jun 2008
Location: Florida
Posts: 88
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:48 PM.