Jump to content

Problem initContent() in my first module


faceofjock

Recommended Posts

Hi,it's my first post in this forum , i hope i will solve my problem.

 

So i'm trying to make my first module ,i added a front controller , but i'm not able to load my template correctly.

 

With  parent::initContent() i got 500 error , whitout it , i got only some parts of my website like this :

post-709071-0-18802600-1379522205_thumb.png

 

HAHAHA is my display.tpl .

 

This is my code :

<?php 
 
class charmoduledisplayModuleFrontController extends ModuleFrontController
{
	public function initContent()
	{
		parent::initContent();
		$this->setTemplate('display.tpl');
	}
}
Edited by faceofjock (see edit history)
Link to comment
Share on other sites

  • 1 year later...
You put the display.tpl within the correct folder?

Place inside the front folder as follows

 

YOURMODULE / views / templates / front / display.tpl

 

Otherwise the controller will not pull the tpl and will return this error

Had this problem recently and managed to solve so, you may have already solved too, but if it happens to someone with need this information

 

An simple axample:

 

529c15c486c6e74b7036fce0a181d641.png

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