Talk:Supporting SEF URLs in your component
m (moved Talk:Adding SEF URL support to your component to Talk:Supporting SEF URLs in your component: Moved page for consistency with Supporting plugins in your component) |
(JRoute::_/BuildRoute problem) |
||
| Line 41: | Line 41: | ||
In the example this refers to, the route has only two segments. "view" and "id". | In the example this refers to, the route has only two segments. "view" and "id". | ||
| + | |||
| + | |||
| + | == BuildRoute not working as expected == | ||
| + | |||
| + | I'm having trouble getting the JRoute::_ function working; it should call the [extensionname]BuildRoute function, right? It seems it currently doesn't do that at my system (1.7). Any hints? | ||
| + | [[User:Munchkin|Munchkin]] 04:57, 6 September 2011 (CDT) | ||
Revision as of 04:57, 6 September 2011
Hi there, for me the following statement does not really makes sense:
function check() { jimport( 'joomla.filter.output' ); $alias = JFilterOutput::stringURLSafe( $this->title ); if (empty( $this->alias ) || $this->alias === $alias ) { $this->alias = $alias; } /* All your other checks */ return true; }
As I read it, the filtered $alias is only asigned to the table property, if $table->alias is empty OR $table->alias is exactly the same. So in case $this->alias is not empty, the property will not even be checked or reasigned.
What I find more logical is the method used in the Joomla components
if(empty($this->alias)) { $this->alias = $this->title; } $this->alias = JFilterOutput::stringURLSafe($this->alias);
What is this supposed to mean
This sentence is confusing me quite a bit:
"The alias is used in the URL instead of the title (the title is the text you want to have in the url)."
Is this a mistake, or do I just not understand. If so, could anybody explain?
Explaination does not match with the example
The following sentence explains the example:
"In the function [Componentname]BuildRoute we arranged the items in the $query array in a specific sequence. This means that in this example the view is first, the catid is second and the id is third in the array."
In the example this refers to, the route has only two segments. "view" and "id".
BuildRoute not working as expected
I'm having trouble getting the JRoute::_ function working; it should call the [extensionname]BuildRoute function, right? It seems it currently doesn't do that at my system (1.7). Any hints? Munchkin 04:57, 6 September 2011 (CDT)