Welcome Guest, Not a member yet? Register   Sign In
BaseController & __construct
#1

(This post was last modified: 05-12-2020, 02:10 PM by jreklund.)

Hi

I have a controller that extends BaseController.

I also need to execute some code in the controllers __construct method.

The __construct gets called before the initController function in the BaseController.

Is there a "2ndary" controller init that I can use that will get called after initController ?

PS. I don't want to start using Filters for this.

PHP Code:
class BaseController extends Controller
{
    public function initController()
    {
        
echo 'basecontroller init<br/>';
        
// ..........


class Search extends BaseController
{
    public function __construct()
    {
        echo 'search __construct<br/>';
        
//......... 

OUTPUT:
search __construct
basecontroller init
Reply


Messages In This Thread
BaseController & __construct - by shaunM_za - 05-12-2020, 01:45 PM
RE: BaseController & __construct - by jreklund - 05-12-2020, 02:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB