1

If I add a weblink via JCE the link will be added with &task=weblink.go

For what is it, and in wich file will this evaluated?

2

A "task" is a class method (function) in a component's controller.

In your case, weblink is the controller and go is a method within the controller.

Here is a simple and clear tutorial: How to add a New Task to your Joomla 3 Component from InmotionHosting.

I'll bring the screen captured snippets into text here, but certainly visit the link for the tutorial.

@ /components/com_helloworld/helloworld.php

<?php
// No direct access to this file
define('_JEXEC') or die('Restricted access');

// import joomla controller library
jimport('joomla.application.component.controller');

// Get an instance of the controller prefixed by HelloWorld
$controller = JControllerLegacy::getInstance('HelloWorld');

// Perform the Request task
$input = JFactory::getApplication()->input;
$controller->execute($input->getCmd('task'));

// Display the name of the task being executed
echo "<p>Just finished executing: " , $input->getCmd('task') , "</p>";

// Redirect if set by the controller
$controller->redirect();

@ /components/com_helloworld/controller.php

<?php
// No direct access to this file
define('_JEXEC') or die('Restricted access');

// import Joomla controller library
jimport('joomla.application.component.controller');

/**
 * Hello World Component Controller
 */
class HelloWorldController extends JControllerLegacy
{
    function shout()
    {
        echo "<p>THIS IS ME SHOUTING!</p>";
    }
}

The effect at example.com/index.php/option=com_helloworld&task=shout would be:

THIS IS ME SHOUTING!
Just finished executing: shout

with the generated source code looking like:

<p>THIS IS ME SHOUTING!</p>
<p>Just finished executing: shout</p>

For supplemental reading:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.