On 12 Okt., 15:04, 浪漫様 <[email protected]> wrote:
> In a normal world, the following code would work... you receive a
> variable on your function, and you save it on a session, then the next
> page is able to read it ( the SET is just to display it on the
> views )... however, in CakePHP 1.3.4 Stable seems to fail, i can see
> the variable on the initial function [ browse ], but is empty in the
> following function [ display ]
>
> function browse($variable) {
> $this->Session->write('mysession.variable', $variable);
> $this->set('variable', $variable);
>
> } // function: browse
>
> function display() {
> $this->set('variable', $this->Session->read('mysession.variable'));
>
> } // function: display
>
> More funny is that the following code DOES WORK:
>
> function browse() {
> $variable = 5;
> $this->Session->write('mysession.variable', $variable);
> $this->set('variable', $variable);
>
> } // function: browse
>
> function display() {
> $this->set('variable', $this->Session->read('mysession.variable'));
>
> } // function: display
>
> So seems the problem i'm experiencing is only with the variable you
> get through the functions parameters... anyone has a clue on what's
> going on? is driving me crazy and it makes no fuc*ing sense. I didn't
> seem to experience that behavior on CakePHP 1.2 though.
> thanks
>
> Rohman
what does your router say? you probably should use something like:
Router::connect('browser/:VAR', array('plugin' => '', 'controller' =>
'yours', 'action' => 'browse', VAR);
i had lot's of problems without using the acronyms after the actions.
i have no idea why but with this router configuration it always worked.
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