php - One website page with several controllers controlling views -
php - One website page with several controllers controlling views -
i'm building own mvc framework in order larn how works.
i have basic framework folder, model, controller , view class. implements basic classic each purpose. illustration model class contains methods db queries, db connection...
this short view of website's tree :
index.php controller |-controllerhome |-controllerstory |-controllerconnection model |-story |-user view |-viewhome |-viewstory |-viewconnexion |-template.php framework |-model.php |-controller.php |-view.php |-router.php
i have main controller router.php calls right controller knowing post data.
my problem can't find proper (i main clean , reusable) way utilize several controller in order build webpage several views.
each webpages made of main content , connexion box, every pages supposed utilize controllerconnection.
currently i'm calling controllerconnection within controllerhome , controllerstory doing so, need write same lines of code on every controller. wrong phone call controller in other controller?
php model-view-controller
Comments
Post a Comment