Render just does what it says it will; render a view. It does not run the 
controller action with the same name. You can try $this->index(); which will 
run the action, but I'm not sure if the values you have set will be available. 
You could drop them into a keyed array (instead of loads of variable) and pass 
them into the index action as an optional variable.

Jeremy Burns
Class Outfit

[email protected]
http://www.classoutfit.com

On 26 Aug 2010, at 00:49, jostster wrote:

> Is it just me misunderstanding what this is supposed to do or is it a
> bug?
> 
> I have an Upload controller with 2 actions.
> 
> index():
> This is where the database query is done to retrieve dropdown list
> values and send them to the index.ctp where the form is created.
> 
> upload():
> This is where the validating is done and the uploading to the system
> is done.
> 
> 
> Problem:
> In upload() I have it do validation and if validation fails then it
> will do Controller::render('index'); so that it will display the form
> again with the error messages.  Even though the index view is
> displayed the UploadController::Index is not run so that the values
> from the database can be retrived.
> 
> Temp solution:
> What I have to do right now is before I call
> Controller::render('index'); I have to call $this->index(); so that
> the database query will be ran and the $this->set() values are created
> for the index.ctp file.
> 
> My understanding of how this SHOULD work is if
> Controller::render('index') is ran then it will run the action for
> index() and then run the index view.  Is this not the case?
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to