16 Nov 2009 @ 6:04 PM 
class customer_list extends MY_Controller
{
    function some_method($customer_id, $subnav_item)
    {
        $this->sub_nav_id = $subnav_item;
        $this->customer_id = $customer_id;
        $uri_string = get_class($this) . '/some_method/' . $this->customer_id . '/' . $this->sub_nav_id;
     }
}

when calling the class I would do something like this : http://www.mysite.com/customer_list/some_method/1/2

This would call the method “some_method” and pass 2 parameters ($customer_id = 1 and $subnav_item = 2)

Its that simple

Posted By: Zayin
Last Edit: 16 Nov 2009 @ 06:14 PM

EmailPermalink
Tags
Tags: ,
Categories: php


 

Responses to this post » (One Total)

 
  1. [...] This post was mentioned on Twitter by Zayin Krige and Muhammad Yoosuf, magpielab. magpielab said: Passing multiple parameters to your CodeIgniter methods – http://bit.ly/WDy3d via @zayinkrige [...]

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.


 Last 50 Posts
 Back
Change Theme...
  • Users » 1
  • Posts/Pages » 38
  • Comments » 61
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Links



    No Child Pages.

Portfolio



    No Child Pages.