dongshang1529
dongshang1529
2015-11-14 10:21

Jcontroller未知类

已采纳

Hi I am new to Joomla and PHP and working on Joomla 3.4 to create a controller.

However I am getting the error as unknown class:'JController'

I am using the below code in my controller.php

<?php
defined('_JEXEC') or die("Access Deny");
jimport('joomla.controller');
class MycompController extends JController{
    function display(){
        echo JText::_('COM_MYCOMP_WELCOME');
    }
    function create(){
        echo JText::_('Create a ner task');
    }
    function list_task(){
        echo JText::_('Create a list task');    
    }
    function help(){
        echo JText::_('Help Section: Checkout the docs');    
    }
}
?>

I know its only related to including controller.php from its path. But I am not getting by using jimport.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

相关推荐