This isn't a cake issue, it's just basic PHP string/variable parsing

Either:

'/questions/add/' . $this->data['Survey']['id']

or

"/questions/add/{$this->data['Survey']['id']}"

or, even better

array('controller' => 'questions', 'action' => 'add', $this-
>data['Survey']['id'])

[slightly more verbose, but it enables reverse routing to work
properly. Get into the habit of it now and it will be easier when you
need it]

On Apr 30, 9:45 am, rtanz <[EMAIL PROTECTED]> wrote:
> trying this but still doesnt work:      echo $html->link('Add Questions',"/
> questions/add/$this->data[Survey][id]");
>
> On Apr 30, 1:30 am, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > You want $this->data[...]
>
> > On Tue, Apr 29, 2008 at 5:21 AM, rtanz <[EMAIL PROTECTED]> wrote:
>
> > >  hi in my view i am trying this code:
>
> > >         echo $html->link('Add 
> > > Questions',"/questions/add/$data[Survey][id]");
>
> > >  in order to insert the id of the survey at the end of that link,
> > >  however it is giving me
> > >  Notice (8): Undefined variable: data [APP/views/surveys/edit.ctp, line
> > >  11]
>
> > >  In the controller dump i have
> > >  [data] => Array
> > >         (
> > >             [Survey] => Array
> > >                 (
> > >                     [id] => 1
>
> > >  what am i doing wrong? thnx- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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