Skip to main content

Timeline for Friendly URL for a custom component

Current License: CC BY-SA 4.0

11 events
when toggle format what by license comment
Apr 28, 2020 at 16:31 vote accept Thiago Guimarães
Apr 3, 2020 at 19:06 comment added Thiago Guimarães I made a modification because i was getting an error (call to udefined method registerView) even importing all classes. Instead of implementing the class Joomla\CMS\Component\Router\RouterInterface i extended the class Joomla\CMS\Component\Router\RouterViewConfiguration. Does it work out? It's not giving me any errors.
Apr 3, 2020 at 18:27 comment added Thiago Guimarães Oh sure, forgive my ignorance and thank you very much.
Apr 3, 2020 at 18:04 comment added Sharky You need to import some classes like Joomla\CMS\Application\CMSApplication.
Apr 3, 2020 at 15:17 comment added Thiago Guimarães I have tried exteding the Joomla\CMS\Component\Router\RouterView class and implementing Joomla\CMS\Component\Router\RouterInterface interface. Both gives me the same error: Argument 1 passed to ComponentRouter::__construct() must be an instance of CMSApplication or null, instance of Joomla\CMS\Application\SiteApplication given in...libraries\src\Router\SiteRouter.php on line 785
Apr 3, 2020 at 14:09 comment added Sharky If you want to use standard routing, the class to extend is Joomla\CMS\Component\Router\RouterView. This is written in the linked documentation.
Apr 3, 2020 at 11:47 comment added Thiago Guimarães I have implement the methods but it gives me another error Argument 1 passed to ComponentRouter::__construct() must be an instance of CMSApplication or null, instance of Joomla\CMS\Application\SiteApplication given in...libraries\src\Router\SiteRouter.php on line 785
Apr 3, 2020 at 11:34 comment added Thiago Guimarães I mean it says the name of the methods but how can i implement them? There's no example.
Apr 3, 2020 at 11:25 comment added Thiago Guimarães I tried to implement the Joomla\CMS\Component\Router\RouterInterface class but it gives me an error ComponentRouter contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods i don't know what methods are those.
Apr 3, 2020 at 10:40 comment added Thiago Guimarães Thank you for your answer but i had tried this and i had no success. The documention isn't clear to me (it might work out for others) but i have had hard times trying to understand the content of that page. I found that quite unhelpful. It didn't even say the class i should extend. I tried to implement the functions and always get an error such as abstract class errors and so on.
Apr 3, 2020 at 6:23 history answered Sharky CC BY-SA 4.0