Welcome Guest, Not a member yet? Register   Sign In
Going back to a calling page
#6

[eluser]LuckyFella73[/eluser]
Phil Sturgeon wrote an article how to extend the base controller:
http://philsturgeon.co.uk/news/2010/02/C...ing-it-DRY

Lets say you extented like shown in the articel and you have a Public_controller extending
the MY_Controller (extending the CI_Controller).
In your Public_controller you can set up some code that saves the pagelinks into
your session.
Code:
<?php
class Public_Controller extends MY_Controller
{
    function __construct()
    {
        parent::__construct();
// here the code for saving ..
$last_url = = $foo_bar_code;
// ...

// them something like
$this->linktag_last_called_page = '<a href="'.$last_url.'">back to last page</a>';
}
}

Now you can set the link in all you view files like this without coding anything
in your "normal" controllers:
Code:
&lt;?php echo $this->linktag_last_called_page; ?&gt;


Messages In This Thread
Going back to a calling page - by El Forum - 02-10-2011, 01:04 PM
Going back to a calling page - by El Forum - 02-10-2011, 05:54 PM
Going back to a calling page - by El Forum - 02-10-2011, 10:00 PM
Going back to a calling page - by El Forum - 02-11-2011, 03:04 AM
Going back to a calling page - by El Forum - 02-11-2011, 07:17 AM
Going back to a calling page - by El Forum - 02-11-2011, 07:44 AM
Going back to a calling page - by El Forum - 02-11-2011, 08:07 AM
Going back to a calling page - by El Forum - 02-11-2011, 08:40 AM
Going back to a calling page - by El Forum - 02-11-2011, 09:02 AM
Going back to a calling page - by El Forum - 02-11-2011, 02:22 PM
Going back to a calling page - by El Forum - 02-11-2011, 02:42 PM
Going back to a calling page - by El Forum - 02-11-2011, 05:54 PM
Going back to a calling page - by El Forum - 02-11-2011, 07:07 PM
Going back to a calling page - by El Forum - 02-13-2011, 03:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB