There is no direct specification for passing multiple parameters from view (.ctp file) to controller (.php file) in cakePHP. It is intuitive !
The format of the url with a single parameter look like : ../myApp/myController/myFunction/parameter1
To pass multiple parameters simply append at the end which might look like
../myApp/myController/myFunction/parameter1/parameter2/parameter3
Some generic ways are:
1.
array ('action' = '/myFunction/'. $id .'/'.$another_id);
2.
$Html-> link ('edit', array ('url'='/ myController/myFunction? Id ='. $Id. '& another_id ='. $another_id)).
3.
$Html-> link ('edit', array ('action' = 'myFunction', $id,$another_id)).
The function in myController would look like:
function myFunction ($id, $another_id){
// do something
}
Subscribe to:
Post Comments (Atom)
Python contextlib for Timing Python code
If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...
-
If you get the following error while installing FFMPEG or other packages on CentOS 7. Requires: libva.so.1(VA_API_0.33.0)(64bit) Follow...
-
Common error: fallocate: fallocate failed: Text file busy in ubuntu OS Check the allocation: free -m or sudo swapon --show Make sure ...
-
How to fix Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' Apparently, Ma...
Thanks, worked very well!
ReplyDeleteThanks
ReplyDeleteSimple. Thanks!
ReplyDeleteThanks
ReplyDeletethank you
ReplyDelete