Pyrocms:创建模块时前端禁止访问
我正在尝试创建一个简单的模块来测试,每当我进入模块页面 http://mysite.com/testmodule 我收到“禁止,访问被拒绝”错误。
该模块唯一做的就是回显一个测试字符串:
<?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';
}
}
知道为什么会发生这种情况吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 PyroCMS 不太熟悉(一点也不熟悉),但它是基于 Codeigniter 的......
在这种情况下,以下内容可能会有所帮助。如果它们不适合 PyroCMS,我们深表歉意。
像这样再试一次:
您的问题可能是:
1)你在构造函数中回显而不是在默认函数中回显
2)你的班级名称不是以大写字母开头
希望有帮助!
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:
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!