Jump to content

Using renderView() in a custom module admin controller


zsigmondszilveszter

Recommended Posts

Hi, 


 


I am a presta newbie and I have the following question. I have already asked this in an existent topic, but am afraid of everybody think that is an answer. Is this the proper way to display something under a back-office modul. I have already tried the hookdisplaySomething method too.


So I created a custom module with custom controller, then  under Administration->Menus I created a new admin menu with the new module and controller. After that I created a test template file under "modules/szilveszterfirst/views/templates/admin/szilveszter_first/helpers/view/test.tpl". Everything works fine, except the renderView function, the template file is loaded(I printed out the result), but in the admin page doesn't show anything. Is there any prerequisite, that I didn't do? e.g. the template should contain something special(actually contains a few html tags for test sake)?


 


The following question is also the same, but is not answered. http://stackoverflow.com/q/28948166/3604337



class AdminSzilveszterFirstController extends ModuleAdminController {

public function __construct() {
$this->lang = false;
parent::__construct();
}

public function initContent(){
$this-> renderView();
return parent::initContent();
}
public function renderView() {
$this->base_tpl_view = 'test.tpl';
//printf("<pre>%s</pre>",print_r(parent::renderView(),true));
return parent::renderView();
}
}

Edited by zsigmondszilveszter (see edit history)
Link to comment
Share on other sites

  • 3 years 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...