Codeigniter check which controller




















In the above example the method name is index. The second segment of the URI determines which method in the controller gets called. If you are using the URI Routing feature, the segments passed to your method will be the re-routed ones.

CodeIgniter can be told to load a default controller when a URI is not present, as will be the case when only your site root URL is requested. If you now load your main index. As noted above, the second segment of the URI typically determines which method in the controller gets called. It overrides the normal behavior in which the URI determines which method is called, allowing you to define your own method routing rules. CodeIgniter has an output class that takes care of sending your final rendered data to the web browser automatically.

More information on this can be found in the Views and Output Class pages. In some cases, however, you might want to post-process the finalized data in some way and send it to the browser yourself. The first parameter of the method will contain the finalized output. If you are using this feature the page execution timer and memory usage stats might not be perfectly accurate since they will not take into account any further processing you do. For an alternate way to control output before any of the final processing is done, please see the available methods in the Output Library.

In some cases you may want certain methods hidden from public access. Codeigniter set default controller function. Codeigniter class not found. Codeigniter load model in library. Codeigniter load model in helper. Codeigniter load model in controller constructor. Codeigniter controller not found Codeigniter controller constructor. Codeigniter Load Views within Views. Codeigniter print last query. Codeigniter print session data variable array.

Codeigniter get post data. Codeigniter download file example. Subquery In Codeigniter Active Records. Codeigniter Load View in Helper. Codeigniter — no input file specified.

Codeigniter Count Rows Of Table. Codeigniter Email Library. Codeigniter Calendar Library. Codeigniter File Upload. Codeigniter Order By Query. Codeigniter multiple where Condition.

Codeigniter get project base path. Codeigniter Add Js Css File. Codeigniter Load Multiple Models. Codeigniter Create Directory. Codeigniter check HTTP method. Delete Directory in Codeigniter. Distinct in Codeigniter Query.

Codeigniter delete multiple rows. You can extend this class in any new controller. Also, always make sure your controller extends the parent controller class so that it can inherit all its methods. If you want another naming convention you need to manually define it using the URI Routing feature.

In the above example, the method name is index. The second segment of the URI determines which method in the controller gets called. If you are using the URI Routing feature, the segments passed to your method will be the re-routed ones.

CodeIgniter can be told to load a default controller when a URI is not present, as will be the case when only your site root URL is requested. A few lines further down Routes.

As noted above, the second segment of the URI typically determines which method in the controller gets called.

It overrides the normal behavior in which the URI determines which method is called, allowing you to define your own method routing rules. In some cases, you may want certain methods hidden from public access. To achieve this, simply declare the method as private or protected.



0コメント

  • 1000 / 1000