What denotes the events in the 'events.add' string?
The 'events.add' is the the same as specifying &task=events.add
in the URL of a link, both of which will direct processing to a Controller called EventsController
and the function/method within that Controller called add
within the current component.
e.g.
class EventsController extends ...
{
public function add()
{
...
}
}
In your example here the New button does not use any information from the List page but it still expects there to be a <form>
defined called adminForm
as most button/link actions is essentially triggering the form to be Submitted, or processed, using Joomla.submit(). I had a similar issue when learning and it was explained here that the name of the form needs to adminForm
for the default joomla.submit()
to work or pass it a different name. TypeError: Form is Null on Button in Admin toolbar
The obvious example for using the values set in a '<form>'
is if you have used the default checkbox approach for your list table. Once you select one or more checkbox's and chose a Menu item like Publish/Unpublish the values of the checkbox's and any other inputs of the form are available to the Controller that is called, in your case EventsController, by getting the right property from the Input object via a statement like this in your controller;
$ids = (array)$this->input->get('cid', array(), 'int')
cid
is the array that holds the values, usually a record identifier of some sort, for each box that was checked on the list.
In the tmpl file for your List page you would probably use this core function to display and handle the show/noshow of the box being checked.
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, $item->id); ?>
</td>
Another use case is the Search & Filter bar that is displayed on many List pages are are <input>
's and therefore expected to be within a <form>
element.