Welcome Guest, Not a member yet? Register   Sign In
Change controller class property
#5

[eluser]yabune[/eluser]
Sorry, I just wanted to simplify but you're probably right, here it's the actual code.

Code:
<?php

class Pages extends MY_Admin_Controller {

    private $abc;

    function Pages()
    {
        parent::MY_Admin_Controller();
        $this->abc = 'bbb';
    }
    
    function index()
    {
    }
    
    function show($page, $sucess = 0)
    {
        echo 'abc:'.$this->abc;
    }
    
    function update($page)
    {
        $this->load->helper('url');
        $this->abc = 'xxxxx';
        redirect('/admin/pages/show/'.$page.'/1', 'location');
    }
}
/* End of file pages.php */

If I call the show function I get bbb.
And if I call the update function I still get bbb and not xxxxx.

Is it because when I redirect a new Pages object is created?
How do I pass a string to another function?

I know I could just call inside update function: $this->show(with some args)
But I would like that the url wasn't http:/.../update but instead to be http://.../show.

Thanks!


Messages In This Thread
Change controller class property - by El Forum - 11-22-2009, 08:27 AM
Change controller class property - by El Forum - 11-22-2009, 09:22 AM
Change controller class property - by El Forum - 11-22-2009, 09:25 AM
Change controller class property - by El Forum - 11-22-2009, 09:33 AM
Change controller class property - by El Forum - 11-22-2009, 10:50 AM
Change controller class property - by El Forum - 11-22-2009, 11:10 AM
Change controller class property - by El Forum - 11-22-2009, 11:18 AM
Change controller class property - by El Forum - 11-22-2009, 11:33 AM
Change controller class property - by El Forum - 11-22-2009, 12:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB