Jump to content

Load Tpl from Custom Backoffice Menu


David_Presta

Recommended Posts

Hi there

 

 

I'm developing a new backoffice module on PS 1.6. I have read the documentation but I'm stuck at this moment. Hope the community can help.

 

My module adds new items on the main backoffice menu:

 

Dashboard

Catalog

Orders

....

....

MyCustomMenu

          ->MyChildCustomMenu

 

 

I have already created the controller class for "MyChildCustomMenu" option in

 

mymodule/controllers/admin/AdminNewItemController.php

 

it has something like:

<?php
class AdminNewItemController extends ModuleAdminController
{
  public function __construct()
  {
    // Enable bootstrap
    $this->bootstrap = true;
    // Call of the parent constructor method
    parent::__construct();
  }
}

I failed to load a custom form (when the user click on "MyChildCustomMenu") from a tpl file (mymodule/views/templates/admin/customform.tpl) using fetch or diplay methods 

 

I don't know what is  correct place to call the tpl (could be on the constructor? ) as well the correct form to load it.

 

I really appreciatte if somebody could explain what is the process flow once the user click on one option of the menu just in order to get a better understood of PS.

 

 

Thanks in advance

Link to comment
Share on other sites

  • 3 weeks later...

I have the same trouble but the proposed solution it doesn't works I get:

 

Fatal error: Uncaught --> Smarty: Unable to load template file '/home/juliodiaz/public_html/develop/www.peloniopress.org/admin3010/themes/default/template/configure.tpl' <-- thrown in /home/juliodiaz/public_html/develop/www.peloniopress.org/tools/smarty/sysplugins/smarty_internal_templatebase.php on line 129

 

Why is it not searching the file at module/view/templates/admin?

 

My Admin Controller is:

class AdminDypRefundController extends ModuleAdminController
{
    
    public function __construct()
    {
        // Enable bootstrap
        $this->bootstrap = true;
        // Call of the parent constructor method
        parent::__construct();
    }
    

    public function initContent()
    {
        parent::initContent();
        $this->setTemplate('configure.tpl');
    }

}

 

And the file "configure.tpl" is in the path: dyprefund/views/templates/admin

 

Thank you in advance

Julio

Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...