How to pass argument to index(arg='') ? |
(06-21-2016, 06:40 AM)zenepay Wrote:(06-21-2016, 05:54 AM)dmyers Wrote: If you want /home and /home/{{id}} you can always write a route in the application/config/routes.php file. Depending on the URI structure you are trying to create/recreate (ie. SEO reason, Business Reason, etc...) and because CodeIgniter uses the first 2 URI segments as the controller and methods (if you aren't using folders http://www.codeigniter.com/user_guide/ge...irectories). Then you will need to add the routes. This is covered here: http://www.codeigniter.com/user_guide/ge...ur-methods Assuming your URI structure isn't for any specific reason then why couldn't you use something like: /people (of course default's to /people/index - list view) /people/new (new record) /people/edit/1 (edit record 1) /people/delete/1 (delete record 1) /people/view/1 (view record 1) /people/details/1 (view record 1) In the example above the Controller would be something like this: class People extends CI_Controller { public function index() {...} public function new() {...} public function edit($id=null) {...} public function delete($id=null) {...} public function view($id=null) {...} public function details($id=null) {...} } |
Messages In This Thread |
How to pass argument to index(arg='') ? - by zenepay - 06-21-2016, 02:18 AM
RE: How to pass argument to index(arg='') ? - by zenepay - 06-21-2016, 03:48 AM
RE: How to pass argument to index(arg='') ? - by dmyers - 06-21-2016, 05:54 AM
RE: How to pass argument to index(arg='') ? - by zenepay - 06-21-2016, 06:40 AM
RE: How to pass argument to index(arg='') ? - by dmyers - 06-21-2016, 08:17 AM
RE: How to pass argument to index(arg='') ? - by InsiteFX - 06-21-2016, 08:13 AM
RE: How to pass argument to index(arg='') ? - by zenepay - 06-27-2016, 10:25 PM
|