I am a newbie in Phalcon PHP and I'm currently developing a CMS.
I am trying to create a blog module where the user can post blog with custom slug like with URL structure.
I am having a problem on routing the URI like I want to check first if the controller or action exists or not. If not, it should redirect to my action handler and check if this is a a blog and if it is not a post it should redirect to 404 page.
I already have a code on my router. I already have a code where it redirects to my view action handle
$router->add(
'/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)',
[
'controller' => 'posts',
'action' => 'viewPostHandler',
'posts_category' => 1,
'posts_slug' => 2
]
);
So, the code I have already accepts any slug and redirects to posts/viewPostHandler and pick a volt. But with this router it is affecting the default /:controller/:action router.
Like, index/loginSubmit is not working anymore.