Jump to content

Recommended Posts

Posted

Dear Ladies and Gentlemen,

I am new to the Blesta Plugin system, but I made it so far that my plugin shows a link in the nav_primary_staff:

http://puu.sh/aPcEW/48bc6ec839.png (see "Newsletter")

 

When I click on this link the index() function of my admin_main.php is called:

http://puu.sh/aPcIw/f60d60bd06.png (this will be rendered)

 

But as you can see there is no navigation (to see the difference: http://puu.sh/aPcOJ/06417b7c2d.png)

 

 

This code is in my admin_main.php (controller):

class AdminMain extends NewsletterController {	
	
    public function index() {
        $this->view->setView(null, "Newsletter.default");
        return $this->partial("admin_main");
    }
}

This code is in my admin_main.pdt (view):

test

I hope you can help me!

 

Greets,

Christopher

Posted

This code is in my admin_main.php (controller):

class AdminMain extends NewsletterController {	
	
    public function index() {
        $this->view->setView(null, "Newsletter.default");
        return $this->partial("admin_main");
    }
}

 

Hi Christopher,

 

If that's the entirety of the controller, then you are missing the preAction method, which should contain a call to the parent::preAction(). See the documentation for more info.

Posted

Hi Tyson,

 

at first thank you very much for your reply.

I added the missing functions as follows:

class AdminMain extends NewsletterController {	
	
	public function preAction() {
		parent::preAction();
	}
	
    public function index() {
        $this->view->setView(null, "Newsletter.default");
        return $this->partial("admin_main");
    }
}

But this does not solve my problem...

 

 

Greets,

Christopher

Posted (edited)

Oh well, I fixed the problem.

The parent controller of this AdminMain Controller also missed the parent::preAction();

 

Now everything works fine.

 

Thank you very much for your help!

 

 

Greets,

Christopher

Edited by christophermaeuer

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...