Inheritance: extends BaseController
class ActivityController extends Controller
{
    /**
     * ActivityController constructor.
     */
    public function __construct()
    {
        parent::__construct();
        $this->posts = new PostMapper();
        $this->activity = new ActivityMapper();
    }
    public function getAllPost()
    {
        $this->ajaxReturn($this->posts->findAll());
    }
    public function getAllActivities()
    {
        $this->ajaxReturn($this->activity->findAll());
    }
    public function getAllAP()
    {
        $this->getAllPost();
        echo Controller::SEPARATOR;
        $this->getAllActivities();
    }
}
if (defined('TEST_SUITE') && TEST_SUITE == __FILE__) {
    // run test suite here
    $analysis = new ActivityController();
    $analysis->distribute();
}
示例#2
0
             if ($route['2'] == 'createNew') {
                 $projectController->createNewProject();
             } elseif ($route['2'] == 'createProject') {
                 $projectController->createProject();
             } elseif ($route['2'] == 'postProjectComment') {
                 $projectController->postProjectComment();
             } elseif ($route['3'] == 'joinProject') {
                 $projectController->joinProject();
             } else {
                 $projectController->render();
             }
             break;
     }
     break;
 case "activity":
     $activityController = new ActivityController($route[2]);
     $where = $route[2];
     switch ($where) {
         case 'postComment':
             $activityController->postComment();
             break;
         default:
             $activityController->render();
             break;
     }
     break;
 case "fileUpload":
     require_once "controllers/FilesController.class.php";
     break;
 case "profile":
     $profileController = new ProfileController($route[2]);