Welcome Guest, Not a member yet? Register   Sign In
Questions about functions within controllers
#1

[eluser]yello[/eluser]
Hi!

I am having a bit of a problem figuring out how to code my new app. I was wondering if there is a way to kinda "redirect" the use of a particular function within the same controller. Let me explain:

Code:
<?
class Generator extends Controller
{
    function Generator()
    {
        error_reporting(0);
        parent::Controller();
        $this->load->model('functions');
        $this->load->model('other');
        $this->load->model('wp');
        $this->load->helper('string');
        $this->load->helper('url');
    }
    
    function index()
    {
        echo("generator");
    }
    
    function content()
    {
        if ($this->segment->uri(3) == 'some-string')
                {
                *redirect to some_string() function within the same controller*
                }
                else
                {
                *redirect another_thing() function*
                }
        }

        function some_string()
        {
               *do something*
        }

        function another_thing()
        {
               *do something else*
        }
}
}

Is that possible to do? I don't know where to put my app "logic".

I hope you guys can help me! (and understand what is my problem Tongue)

Thanks!


Messages In This Thread
Questions about functions within controllers - by El Forum - 03-31-2008, 10:13 AM
Questions about functions within controllers - by El Forum - 03-31-2008, 10:36 AM
Questions about functions within controllers - by El Forum - 03-31-2008, 02:27 PM
Questions about functions within controllers - by El Forum - 03-31-2008, 04:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB