Sunday, March 20, 2011

Re: cakephp-wizard Redirect Loop

The first thing I see is that your wizard() method assigns the
parameter to the "$steps" variable, but never uses $steps within the
method itself -- it passes the "$step" variable to $this->Wizard-
>process(), and you haven't defined the value of the "$step" variable.

I'm assuming you are trying to adapt the code from
https://github.com/jaredhoyt/cakephp-wizard/wiki/Step-2:-View-Preparation-and-Data-Processing
. Note the name of the variable being used for the parameter in the
function wizard().

On Mar 20, 7:47 am, grady <gradye...@gmail.com> wrote:
> I have installed the cakephp-wizard plugin from github and am trying to
> progress through the tutorial but am unable to get past step one...
>
> I have set up a controller to handle the multi-page form as follows:
>
> class CreateController extends AppController {
> var $name = "Create";
> var $components = array("Wizard.Wizard");
> var $uses = array("Artifact");
>  function beforeFilter() {
> $this->Wizard->steps = array("artifact");}
>
>  function wizard($steps = null) {
> $this->Wizard->process($step);
>
> }
>
> function _prepareArtifact() {
>        // TODO
>
> }
>
> function _processArtifact() {
> $this->Artifact->set($this->data);
>
> if($this->Artifact->validates()) {
> return true;
>
> }
> return false;
> }
> }
>
> I have created a view for this controller in app/views/create/ called
> artifact.ctp which contains a simple creation form.
>
> I have re-routed in app/config/routes.php so that /create points to
> /create/wizard/artifact.
>
> When I try to navigate to the page Chrome (and Firefox, etc.) tells me that
> there is a redirect loop.  Is cakephp-wizard broken in cakephp 1.3.7, or
> (more likely) am I doing something stupid?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate