Reputation: 1305
I am trying to create a simple module to test things out and whenever I go to the module page http://mysite.com/testmodule I get a "forbidden, access denied" error.
the only thing the module does is echo out a test string:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class testmodule extends Public_Controller
{
/**
* Constructor method
*
* @author PyroCMS Dev Team
* @access public
* @return void
*/
public function __construct()
{
parent::__construct();
echo 'test';
}
}
Any idea why this might be happening?
Upvotes: 0
Views: 360
Reputation: 385
I'm not overly familiar with PyroCMS (as in, not at all) but it is based on Codeigniter... in which case, it seems likely that the following might help. Apologies if they are not appropriate for PyroCMS.
Try it again like this:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Testmodule extends Public_Controller
{
/**
* Constructor method
*
* @author PyroCMS Dev Team
* @access public
* @return void
*/
public function __construct()
{
parent::__construct();
}
public function index()
{
echo 'Test';
}
}
Your problems may be: 1) You were echoing in your constructor not in a default function 2) Your class name did not start with a capital letter
Hope that helps!
Upvotes: 1