Jon
October 25, 2010, 4:03pm
1
I have been making some modules for the site www.usaflightclub.com however, even though my code is in the right place etc.The modules won’t show just getting a "Te Module ____ Doesn’t exisit@ My modules code for example:
<?php
class east extends CodonModule
{
public function index()
{
Template::Show('east_region.tpl');
}
}
?>
You Help is most welcome,
Thanks,
Jon
Make sure your modules folder is within the modules folder and your file is within it:
/core/modules/East/East.php
You really should start all class files with a capital and also use a capital in the class declaration in your file
class East extends CodonModule
Some servers get a little picky with case and it usually can be tracked down to the naming of classes.
You will save yourself some headaches with “headers already sent” errors by removing the closing php tag (?>) from your module files as well.
Just a heads up also, Nabeel has started to transition the structure to the use of $this-> for commands within the files.
$this->show('mytemplate.tpl'); or
$this->render('mytemplate.tpl');
and to set data
$this->set('data', $data);
Jon
October 25, 2010, 4:13pm
3
So it’d be
<?php
class East extends CodonModule
{
public function index()
{
$this->render('east_region.tpl');
}
}
?>
?
Yes, and your folder name and file name needs to be “East” as well.
Jon
October 25, 2010, 4:18pm
5
Ok, all working thanks for that