PreprocessRules
Implements RulesInterfaceRule to prepare the query and add missing information
This rule adds the alias to an ID query parameter and the category ID if either of them is missing. This requires that the db table contains an alias column. This fixes sloppy URLs in the code, but doesn't mean you can simply drop the alias from the &id= in the future. Cleaning up every request with this would mean a significant performance impact
| since |
5.3.0 |
|---|---|
| package |
Joomla CMS |
Methods
__construct
Class constructor.
__construct(\Joomla\CMS\Component\Router\RouterViewConfiguration view, table, key, parent_key = null) :
| since |
5.3.0 |
|---|
Arguments
- view
RouterViewConfigurationView to act on- table
stringTable name for the views information- key
stringKey in the table to get the information- parent_key
stringColumn name of the parent key
Response
mixed
build
Dummy method to fulfil the interface requirements
build(mixed||string|int &query, mixed||string|int &segments) :
| since |
5.3.0 |
|---|
Arguments
- query
array<string|int, mixed>The vars that should be converted- segments
array<string|int, mixed>The URL segments to create
Response
void
parse
Dummy method to fulfil the interface requirements
parse(mixed||string|int &segments, mixed||string|int &vars) :
| since |
5.3.0 |
|---|
Arguments
- segments
array<string|int, mixed>The URL segments to parse- vars
array<string|int, mixed>The vars that result from the segments
Response
void
preprocess
Finds the correct Itemid for this query
preprocess(mixed||string|int &query) :
| since |
5.3.0 |
|---|
Arguments
- query
array<string|int, mixed>The query array to process
Response
void
Properties
table
DB Table to read the information from
| since |
5.3.0 |
|---|
Type(s)
string
key
ID column in the table to read the information from
| since |
5.3.0 |
|---|
Type(s)
string
parent_key
Parent ID column in the table to read the information from
| since |
5.3.0 |
|---|
Type(s)
string