Well, the only reason that '$mydisplay' is in the url rather than 5,
is because variable substitution only happens automatically in php
when using double quote strings, not single quote.
'url'      => "/books/lister/?id=1&display=$mydisplay",
will do what you want.

Or are you asking how to modify this parameter using Javascript, based
upon the user interaction in a page?


On Feb 18, 6:53 am, "skyblueink" <[EMAIL PROTECTED]> wrote:
> I know this in not a Cake problem, but I think it's what we come
> across frequently in real world.
>
>   <?php
>     $mydisplay = 5;
>
>     $options = array(
>         'update'   => 'view',
>         'url'      => '/books/lister/?id=1&display=$mydisplay',
>         'type'     => 'asynchronous',
>         'loading'  => "Element.hide('view');",
>         'complete' =>
> "Element.show('indicator');progressBy(n);Effect.Appear('view');"
>     );
>     echo 
> $javascript->event('window','load',$ajax->remoteFunction($options),false);
>
>     ?>
>
> The value of $mydisplay will be changed frequenlty. Then how can I
> pass the value of $mydisplay (5) to /book/lister/ via GET method? As
> you can see, in the preceding example the string '$mydisplay' itself
> is passed to /books/lister, not its value 5.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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