getting the instance of controllers Joomla
So im trying to create my first component and for this ive created the
following controller:
<?php
defined('_JEXEC') or die ('Access denied!');
/**
* Created by JetBrains PhpStorm.
* User: Marc
* Date: 18-08-13
* Time: 02:18
* To change this template use File | Settings | File Templates.
*/
jimport( 'joomla.application.component.controller' );
class MyCompController implements JController{
function create(){
echo "Welcome to create";
}
function delete (){
$id =JRequest::getVar('id');
echo "you want to delete "-$id;
}
}
Now i am not very familiar with joomla and could only find documentation
for 2.5 where
$controller = JController::getInstance('MyComp');
was a relevant way to get your controller instance.
i looked at the interface and JController interface does not supply a
getInstance method because of this i tried:
$controller = JController::getApplication('MyComp');
But with no luck.
So how do you get the controller?
No comments:
Post a Comment