when i create an action and then click on it i get js error
Uncaught TypeError: Unable to read the task of the undefined property (in chrome)
TypeError: b - undefined (in ff)
my code is:
view.html.php
<?
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
class ObshViewObsh extends JView
{
function display($tpl = null)
{
$task = JRequest::getVar('task', '');
switch($task){
case 'config': $this->config();break;
default: $this->windows();
}
parent::display($tpl);
}
function windows(){
JToolBarHelper::title( JText::_( '' ), 'generic.png' );
JToolBarHelper::custom('config','options','','',false);
}
function config(){
JToolBarHelper::title( JText::_( ' - ' ), 'generic.png' );
JToolBarHelper::apply('edit_config');
JToolBarHelper::cancel('cancel');
}
}
controller.php
<?php
error_reporting(E_ALL);
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.controller');
class ObshController extends JController
{
function config(){
JRequest::setVar( 'view', 'obsh' );
JRequest::setVar( 'layout', 'config' );
JRequest::setVar( 'hidemainmenu', 1 );
parent::display();
}
}
source
share