Benutzer-Werkzeuge

Webseiten-Werkzeuge


joomla:framework:query-parameter

Joomla - Query parameter

Joomla uses query parameters in the dispatcher and controller logic to decide what part of the application should be executed. Fot that it parses the URL and extract the GET and POST variables into the JInput object of the application. The parameters can be read out and used everywhere inside the application to make the decisions.

This is how a URL with the http network protocol looks like:

The section in the URL marked as „query“ is the section where the query parameters or GET variables are placed. Every parameter consists of a key=value pair and is separated by a and-sign (&). It is also possible to pass query parameters within the data section of the http header if you are using a POST request. Joomla will recognise and use both the same way.

Standard query parameters

Parameter Description Default value
option The component (e.g. „com_contact“) to be run com_cpanel
task The task to be performed from the component display
controller The controller to be used to perform the task display
view The view to be chosen to show the result of the task same as controller
layout The layout to be used in the view (view-template) default
tmpl The template to use to render the view (site-template) the default template
format The document format to be responded html
lang The languge to use for replacing the language strings en-GB

Descriptions

option

This parameter decides, which component will be used to perform the requested task. After the application is created and initialised a dispatcher is called which boots the component based on this parameter.If there is no option parameter given the app dispatcher will use the default component of this application. The default component for the adinistrator application is com_cpanel.

controller

This parameter tells the application which controller has to be used to perform the requested task. After the component is booted and initialised the ComponentDispatcher will create and execute the controller based on the provided task and/or controller parameter.

task

This parameter tells the application which task has to be performed. A task can be eighter one value or two values separated by a point (.). If you provide two point-separated values, the first value will be used as the controller value and the second one as the task value.

view

This parameter decides about the view to be used to render the output of the requested task. Together with the format, layout and tmpl parameter it is responsible how the output/response will look like. In a Joomla standard runtime the view parameter is only required if the task is „display“ to generate a response to be displayed in the frontend.

layout

This parameter tells the view which template to use to render the output. The layout has to be available in the tmpl folder of the component and there within the folder with the same name as the view. By default there should always be a default.php within this folder as this is the default layout used if no layout parameter is provided.

format

This parameter decides which view-format will be used. Each format needs a php file in /src/View and there within the folder with the same name as the view. The default format html needs for example a view file called HtmlView.php. Since html is the default format this file has to be there for each view.

tmpl

This parameter decides which template will be used to render the complete site including the component view. If this parameter is not provided the default template for the respective applictaion will be used. For the Joomla 4 administrator application this will be the atum template. If you set the tmpl parameter to component, no template will be used and only the component view will be rendered without anything else (No modules, no navigation, no html from templates).

lang

This parameter decides about the language to be used for the output. Based on this parameter the language strings will be translated with the corresponding translation ini files. Default language is en-GB (british english).

joomla/framework/query-parameter.txt · Zuletzt geändert: 28/07/2023 11:50 von Manuel