[Catalyst] detach behaviour clarification

Geoff Flarity geoff.flarity at gmail.com
Thu Nov 1 18:54:55 GMT 2007


Thanks, things are starting make more sense :)

Geoff

On 11/1/07, Antano Solar <solar345 at gmail.com> wrote:
>
>
>
> On 11/1/07, Geoff Flarity <geoff.flarity at gmail.com> wrote:
> >
> > Hi everyone,
> >
> > I've seem to run into a behavior discrepancy between the included dev
> > server and apache when using $c->detach. But I'd like to confirm my
> > understanding of exactly how detach should behave before I debug any fu=
ther.
> > Please consider the following example:
> >
> > sub one : Local {
> >   my ($self, $c ) =3D @_;
> >   $c->forward( '_two')
> >   $c->stash->{template} =3D 'one.tt2'
> > }
> >
> > sub two : Private {
> >   my ($self, $c ) =3D @_;
> >   $c->detach('_three');
> >   $c->stash->{template} =3D 'two.tt2'
> > }
> >
> > sub three : Private {
> >  my ($self, $c ) =3D @_;
> >  $c->stash->{template} =3D 'three.tt2';
> > }
> >
> > My current understanding is that the value of template should be
> > three.tt2. Is this correct?
> >
> > Thanks,
> > Geoff
> >
> > No !
> When you use forward unlike detach the  statements that follow the forward
> are also executed.
> Which means , the last statement to be executed should be
> $c->stash->{template} =3D ' one.tt2'
>
> Antano Solar John
>
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071101/a57a3=
399/attachment-0001.htm


More information about the Catalyst mailing list