Results 1 to 3 of 3

Thread: Access to local variables in child object

  1. #1
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Access to local variables in child object

    I thought this would work. I'm making a child of EventReader where I want to call the reader to do the normal template setup and parse the event template, upon returning to the child, I will modify the template object further and re-parse it.

    Is this even possible, or will I have to copy all the code over:

    Code:
    	protected function compile()
    	{
    		global $objPage, $objTemplate; // wanted to define it global so that I can have access to it upon parent return
    
    		parent::compile(); // here the $objTemplate is created with a = new Template();
    		
    		$objTemplate->hasMore = true; // generates a error, stdObject created
    Otherwise, I'll just have to copy the entire class and modify and not make it a child.

  2. #2
    User
    Join Date
    06-19-09.
    Posts
    326

    Default Re: Access to local variables in child object

    can you link (on github) the original source code you wish to "extend"?

    what do you want to accomplish exactly?
    Consulenza Contao CMS https://www.intco.it

  3. #3
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Access to local variables in child object

    no worries. I just copied the event reader code into a new module.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •