Codeigniter Controller Function And Parameters

Codeigniter controller function and parameters : The codeigniter controller contains the methods inside it. The parameters passed in url along with function name are directly received inside the methods.

Codeigniter controller function And parameters Example

Lets Understand with the following example and demo :

1. Call index() function :

To access index() function hit like this :

Where index calls index() function.


Try it »

1. Call profile() function :

To access profile() function hit like this :

Where profile calls function() function.


Try it »

1. Call comments() function with parameters :

You can define default parameter in function as :

Access the comments function with parameter :

Where first parameter is id and second is name as defined in parameter which will be received in parameters $id, $name .


Try it »

📖 Read More