在 joomla 1.5 组件中包含 amazon 库时出错
我一直在创建一个组件来管理我的亚马逊网络服务上的一些数据,我想使用亚马逊库来处理它,但我遇到了一个错误,这里是错误:
Fatal error: Class 'JView' not found in C:\xampp\htdocs\joomla1\administrator\components\com_amazon\views\amazon\view.html.php on line 8
这里的代码来自视图:
jimport('joomla.application.component.view');
class AmazonViewAmazon extends JView{
function display()
{
$this->setLayout('table_layout');
parent::display();
}
}
这很奇怪因为只有当我从亚马逊包中需要 sdk 库时才会发生错误,这是我的控制器代码:
jimport('joomla.application.component.controller');
class AmazonController extends JController
{
function display()
{
require_once(JPATH_COMPONENT.DS.'lib'.DS.'amazon'.DS.'sdk.class.php');
parent::display();
}
}
如果我尝试从上面的代码中注释掉 require_once 语句,组件将成功加载,是否有人能够遇到我遇到同样的问题或任何人知道如何解决它?任何答案都受到高度赞赏。 :)
I have been creating a component that will manage some data on my amazon webservice and I would like to use the amazon library on working with it but I have been encountering an error here is the error:
Fatal error: Class 'JView' not found in C:\xampp\htdocs\joomla1\administrator\components\com_amazon\views\amazon\view.html.php on line 8
here the code coming from the view:
jimport('joomla.application.component.view');
class AmazonViewAmazon extends JView{
function display()
{
$this->setLayout('table_layout');
parent::display();
}
}
It's weird cause the error will only happen when I require the sdk library from the amazon package here is the controller code I have:
jimport('joomla.application.component.controller');
class AmazonController extends JController
{
function display()
{
require_once(JPATH_COMPONENT.DS.'lib'.DS.'amazon'.DS.'sdk.class.php');
parent::display();
}
}
If I try to comment out the require_once statement from the code above the component will load successfully, is there anyone who is able to encounter the same problem I'm encountering or anyone who has knowledge about how to resolve it? any answer is highly appreciated. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在这里遇到了同样的问题。尝试使用命名空间修复它,但没有帮助,所以我切换到这个解决方案 http://unDesigned.org.za/2007/10/22/amazon-s3-php-class
它非常简单并且完美地完成了任务。
I impacted the same problem here. Tried to fix it with namespaces which did no help, so I switched to this solution http://undesigned.org.za/2007/10/22/amazon-s3-php-class
It's pretty simple and does the trick perfectly.