Jump to content

AdminController Show custom HTML code without tpl file


Recommended Posts

Hi, I want to create a quite complex backend page (my first module so far) in PS 1.7.8.0. I've created a ModuleAdminController and want to show the content without using a tpl file. It's there any way to do so ? if not what I've to do to show the content on the backend page ?

class AdminXXSupplierOrdersController extends ModuleAdminController
{
    public function __construct()
    {
        parent::__construct();
        $this->display = 'Hello World';

But I get no Hello World in page.

I found tutorials on how to build a frontend module with a config admin, but not an admin page where I can manage datas in PS fields the way I want to show it

Thank you for your help.

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

2 hours ago, knacky said:

public function initContent()

{

    parent::initContent();

    $html = '<div>';

    $html .= 'Hello World';

    $html .= '</div>';

    return $html;

}

Thank you knacky. This example above didn't work but I ended up with this working code:

	public function initContent()
	{
		$html = '<div>';
		$html .= 'Hello World';
		$html .= '</div>';

		$this->content = $html;
		parent::initContent();
	}

You helped me a lot with your function and now I can continue to work on it. Thank you !

  • Like 2
Link to comment
Share on other sites

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...