The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: rewrite url with plugin
PostPosted: Wed Feb 08, 2012 9:56 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jan 03, 2012 2:31 pm
Posts: 16
Hello everyone!
in the folder "includes" is "router.php" where we are:
_buildSefRoute and _parseSefRoute
that are used to write and read the url.
As you can override these methods with a plugin?
To me it would take to rewrite the url with plugin, if you know other ways is fine!


Top
 Profile  
 
PostPosted: Thu Feb 23, 2012 4:04 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Sep 21, 2010 3:35 pm
Posts: 37
Location: Madrid (Spain)
Hi,

routing is a task supposed to be implemented in components, not plugins. If you create a component with a file called fouter.php in its root folder (/components/com_[whatever]/router.php) then Joomla will invoke it automatically on every request.

_________________
Soporte técnico Joomla en Español: http://www.expertosjoomla.es


Top
 Profile  
 
PostPosted: Thu Feb 23, 2012 8:47 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jan 03, 2012 2:31 pm
Posts: 16
But remember that JoomSEF acesef or allowed to change the url thanks to a plugin (if not mistaken)


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 8:12 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Sep 21, 2010 3:35 pm
Posts: 37
Location: Madrid (Spain)
Maybe you can implement onAfterInitialise (http://docs.joomla.org/Plugin/Events/Sy ... Initialise) in a plugin and do your magic there. I would start by debugging in your local server to find out what data is available a that point

_________________
Soporte técnico Joomla en Español: http://www.expertosjoomla.es


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 10:51 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jan 03, 2012 2:31 pm
Posts: 16
but within this function, then I can override _buildSefRoute?
or should I make more?
Another thing: if the function onAfterInitialise now means that all URLs are rewritten already, is not it?


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 10:56 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Sep 21, 2010 3:35 pm
Posts: 37
Location: Madrid (Spain)
Not really. What you do here is change the variables in JRequest:
option -> the component name
view-> the view in the component
format -> the format

your plugin will execute before Joomla decides who should handle the request, so you can change the behavior without rewrite the url.

_________________
Soporte técnico Joomla en Español: http://www.expertosjoomla.es


Top
 Profile  
 
PostPosted: Fri Feb 24, 2012 11:12 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jan 03, 2012 2:31 pm
Posts: 16
But I have to make sure that the _buildSefRoute function is not performed, otherwise overwrites my job to rewrite url


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 



Who is online

Users browsing this forum: CoolByteCh and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group