How is a page added programmatically?

Feed 10 posts, 4 voices

Avatar
9 posts

I am looking at the inner workings of the Frog CMS and have figured the basics of it out and I am beginning to build onto it to learn more.

Anyway, I found the add() and _add() function. What is the difference and how are they referenced in the code? Like how is the function called? I see urls such as ‘snippet/add’ but there are no files by that name so I can only assume the ‘/add’ is a parameter? I am beginning to learn MVC at the same time so I may just be missing a connection between the pages.

Thanks,
Levi

 
Avatar
486 posts

add would be a method of the snippet controller, not a parameter.

 
Avatar
9 posts

Forgive me because I am still new at this but, how does add() know it is being called / how is it called?

 
Avatar
486 posts

i think the routing is handled in main.php

 
Avatar
9 posts

Doesn’t main.php handle front end code as opposed to back end?

 
Avatar
541 posts

this is all path (url) dispatcher technic

ex: /page/edit/2 withh call the Page Controller and the fonction edit with param value to 2

$page->edit(2);

this is the basic way it works

 
Avatar
651 posts

Doesn’t main.php handle front end code as opposed to back end?

Depends on which Frog version you’re using.