![]() |
| can i have a controller and action without passing a id |
|
jack_lkh
|
i was a beginner in trax, and i would like to know is threre any setting require to to a controller -> action, can be use without id
like http://localhost/user/index there will be a warning msg display(said id is not found) but http://localhost/user/index/1 is ok thanks |
||||||||||||
|
|
|||||||||||||
|
johnpipi
|
in any controller if no action is specified it will look for by default the action called "index" so if you goto just: http://localhost/user it should load the index action automatically. You shouldn't need an id because that is just a param and doesn't have anything to do really with how it calls the action in the controller. It's more for if you want to load user 1 you or something like that where you are loading a model user id = 1... What is the warning message you are getting?
|
||||||||||||
|
|
|||||||||||||
|
jack_lkh
|
if i have a page controller call user
and have a function call index and i created a view if i go to http://localhost/user it will display Notice: Undefined offset: 2 in /usr/share/pear/PHPonTrax/vendor/trax/action_controller.php on line 519 and if i go to http://localhost/user/index it will still display the above error msg is that i need to define route which do not contain /:id? thanks =] |
||||||||||||
|
|
|||||||||||||
|
jack_lkh
|
Thanks ~=]
|
||||||||||||
|
|
|||||||||||||
| can i have a controller and action without passing a id |
|
||
|
Content © PHPonTrax.com; Powered by phpBB


