I’m currently trying to develop my own module.
I’m getting this error:
Error The following tag cannot be processed: {exp:lmp:add} Please check that the ‘lmp’ module is installed and that ‘add’ is an available method of the module
This is the code I’m trying out (filename is mod.lmp.php):
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Lmp {
public $EE;
public $return_data = '';
public function __construct()
{
$this->EE =& get_instance();
$this->EE->load->library('lmpapi');
}
function add()
{
return 'Test';
}
}It should be noted that I already tried using Lmp() instead of __construct().
I’m using EE 2.5.3.
The mcp.lmp.php and upd.lmp.php works fine - I already created a control panel which works perfectly. Now I need som data to use in my templates.
Anyone know what could be wrong? Or maybe some tips on how to debug this?
Are you sure the module is installed properly in the db? I am assuming the answer is yes because you can access the module in the CP, but non the less. If yes, do you have any other classes that you have named Lmp? You would think that this would throw a PHP error, but I have seen it where it just throws up the error page you are getting. Also make sure there are no funky invisible character hanging around. For instance, if you copied and pasted the <?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’); from somewhere else.
Also, open up the Template.php file in the libraries folder and around line 1200, just search for “Problem Processing Module: Module Not Installed”, start var_dumping variables. This is a good starting place to trace the potential issue through the EE.
Thank you for your help - by starting debugging I noticed that I added my module name to the modules table in all lowercase, which means when the template tries to find the module I wan’t to use, the ucfirst() name of my module from the loaded module list, didn’t match my all lowercase module name.
It’s working now 😊
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.