if ($ctrl == 'posts' && $method == 'GET') { include 'view/post.php'; } if ($ctrl == 'post' && $method == 'GET') { $con = new commentController(); $con->return_comments_list($param); } if ($ctrl == 'post' && $method == 'POST') { $con = new postController(); $con->new_post(); } if ($ctrl == 'comment' && $method == 'POST') { $con = new commentController(); $con->new_comment(); } if ($ctrl == 'search' && $method == 'GET') { $con = new searchController(); $con->search(); } if ($ctrl == 'user' && $method == 'POST') { $con = new userController(); $con->new_user(); } if ($ctrl == 'user' && $method == 'GET') { $con = new userController(); $con->get_profile(); } if ($ctrl == 'login' && $method == 'POST') { $con = new authController(); $con->login(); }