Module Creation

Started by crazor, January 14, 2014, 10:06:46 PM

crazor

We are trying to write a module for HB to use WHMCS Reseller API for licenses for our customers. However when we try to make a default module called "helloworld" to see it in the view when clicking "Manage", it does not display anything.

Tried multiple things to get it to show text but nothing.. any idea as to why?


zero0097

When clicking manage, the module will call the admin controller defined in your module something like this yourmodulefolder/admin/class.yourmodulename_controller.php inside that file create class yourmodule_controller extends HBController then define function _default($request), and inside it use $this->template->assign('hello', 'hello world'); then render some tpl file ($this->template->render($tplfile)) you've created might be something like yourmodulefolder/views/hello.tpl inside that file use smarty syntax, can be something like this <h2>{$hello}</h2>, and there you go, hello will be replaced with 'hello world'.