Welcome Guest, Not a member yet? Register   Sign In
How to use URL to define response type
#6

[eluser]rjsmith[/eluser]
Code:
//In application/core/My_Controller.php
class My_Controller extends CI_Controller{
    public function __construct(){
        parent::__construct();
    }
    public function html(){
        //code here
    }

    public function json(){
        //code here
    }

    public function xml(){
        //code here
    }
}

//In application/controllers/page.php
class Page extends My_Controller{
    //html, json, and xml methods still available and overloadable
}

My example code is different from what I suggested and may be closer to what you were initially wanting to do, but with a bit of tweaking it would still work with my first suggestion.


Messages In This Thread
How to use URL to define response type - by El Forum - 02-09-2013, 05:40 AM
How to use URL to define response type - by El Forum - 02-10-2013, 02:45 AM
How to use URL to define response type - by El Forum - 02-20-2013, 04:00 AM
How to use URL to define response type - by El Forum - 02-20-2013, 05:46 AM
How to use URL to define response type - by El Forum - 02-20-2013, 02:07 PM
How to use URL to define response type - by El Forum - 02-20-2013, 10:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB