I'm having trouble following the MVC standard. |
i do mostly everthing from routes .So suppose on dev localhost , I have a view displaying : http://127.0.0.7/blogArticle/Southhall-Church-Park
via Code: <a href = blogArticle/Southhall-Church-Park> Southhall-Church-Park </a> blogArticle is connected to a route and Southhall-Church-Park is a slug I have in a slug field of slug in app/config/Routes.php i have : Code: $routes->get('blogArticle/(:segment)', 'Blog::showArticle/$1'); so in the above anything in a url with blogArticle is going to get picked up whats on the left i.e the url section is going to get passed to a controller called Blog.php and processes in a function as follows Code: Blog::showArticle/$1 Code: public function showArticle($theSlug) So you can design how menu or a href links in views are handled |
Messages In This Thread |
I'm having trouble following the MVC standard. - by LieoUhlerredyh - 03-09-2023, 02:47 AM
RE: I'm having trouble following the MVC standard. - by qury - 03-09-2023, 02:05 PM
RE: I'm having trouble following the MVC standard. - by captain-sensible - 03-09-2023, 02:26 PM
|