public static function dispatch() { $path = str_replace(PATH, '', $_SERVER['REQUEST_URI']); $method = $_SERVER["REQUEST_METHOD"]; foreach (self::$routes as $route) { if ($route['path'] == $path && $route['method'] == $method) { $name = 'controllers\\' . $route['controller']; $controller = new $name(); if ($method == 'POST') { $postdata = file_get_contents("php://input"); $request = json_decode($postdata); return $controller->{$route}['action']($request); } else { return $controller->{$route}['action'](); } } elseif (strpos($path, $route['path']) !== false && $route['method'] == $method && array_key_exists('param', $route)) { $name = 'controllers\\' . $route['controller']; $controller = new $name(); $param = str_replace($route['path'] . '/', '', $path); return $controller->{$route}['action']($param); } } $controller = new controllers\BaseController(); return $controller->notFound(); }
public function __construct(ImageHandlerInterface $imageHandler, ConfigReaderInterface $reader) { parent::__construct($imageHandler, $reader); $this->imageHandler = $imageHandler; $this->reader = $reader; $this->config = Config::get("app.config"); }
/** * Create a new BrowseController instance. * * @param \Tricks\Repositories\CategoryRepositoryInterface $categories * @param \Tricks\Repositories\TagRepositoryInterface $tags * @param \Tricks\Repositories\TrickRepositoryInterface $tricks * @return void */ public function __construct(CategoryRepositoryInterface $categories, TagRepositoryInterface $tags, TrickRepositoryInterface $tricks) { parent::__construct(); $this->categories = $categories; $this->tags = $tags; $this->tricks = $tricks; }
/** * Create a new UsersController instance. * * @param \Tricks\Repositories\UserRepositoryInterface $users * @return void */ public function __construct(UserRepositoryInterface $users, TagRepositoryInterface $tags, CategoryRepositoryInterface $categories) { parent::__construct(); $this->users = $users; $this->tags = $tags; $this->categories = $categories; }
/** * Create a new TrickController instance. * * @param \Tricks\Repositories\TrickRepositoryInterface $trick * @param \Tricks\Repositories\TagRepositoryInterface $tags * @param \Tricks\Repositories\CategoryRepositoryInterface $categories * @return void */ public function __construct(TrickRepositoryInterface $trick, TagRepositoryInterface $tags, CategoryRepositoryInterface $categories) { parent::__construct(); $this->beforeFilter('auth'); $this->trick = $trick; $this->tags = $tags; $this->categories = $categories; }
/** * Create a new UserController instance. * * @param \Tricks\Repositories\TrickRepositoryInterface $tricks * @param \Tricks\Repositories\UserRepositoryInterface $users */ public function __construct(TrickRepositoryInterface $tricks, UserRepositoryInterface $users) { parent::__construct(); $this->beforeFilter('auth', ['except' => 'getPublic']); $this->user = Auth::user(); $this->tricks = $tricks; $this->users = $users; }
/** * Create a new SitemapController instance. * * @param \Tricks\Repositories\TrickRepositoryInterface $tricks * @return void */ public function __construct(TrickRepositoryInterface $tricks, CategoryRepositoryInterface $categories, TagRepositoryInterface $tags) { parent::__construct(); $this->tricks = $tricks; $this->tags = $tags; $this->categories = $categories; $this->sitemap = App::make("sitemap"); }
/** * Create a new TrickController instance. * * @param \Tricks\Repositories\TrickRepositoryInterface $trick * @param \Tricks\Repositories\TagRepositoryInterface $tags * @param \Tricks\Repositories\CategoryRepositoryInterface $categories * @return void */ public function __construct(TrickRepositoryInterface $trick, TagRepositoryInterface $tags, CategoryRepositoryInterface $categories) { parent::__construct(); $this->beforeFilter('auth'); $this->beforeFilter('trick.owner', ['only' => ['getEdit', 'postEdit', 'getDelete']]); $this->trick = $trick; $this->tags = $tags; $this->categories = $categories; }
/** * Public constructor */ public function __construct() { parent::__construct(); try { $this->profileModel = new ProfileModel(); } catch (DatabaseException $e) { (new ErrorsController())->error503(); } }
public function __construct() { parent::__construct(); $this->data["userAuthorized"] = false; $this->addBefore("update", array("userLogged", "userAuthorized")); $this->addBefore("profile", array("userLogged")); $this->addBefore("settings", array("userLogged")); $this->addBefore("updateAvatar", array("userLogged")); $this->addBefore("delete", array("userLogged", "userAuthorized")); }
public function __construct() { parent::__construct(); $this->addBefore("create", array("userLogged")); $this->addBefore("delete", array("userLogged", "load", "loadPermission", "isOwner")); $this->addBefore("show", array("userLogged", "load", "loadPermission")); $this->addBefore("update", array("userLogged", "load", "loadPermission", "isOwner")); $this->addBefore("addUsers", array("userLogged", "load", "loadPermission", "isOwner")); $this->addBefore("removeUser", array("userLogged", "load", "loadPermission", "isOwner")); $this->addBefore("newGroup", array("userLogged")); $this->addBefore("usersList", array("userLogged", "load")); $this->data["permission"] = 0; }
public function __construct() { parent::__construct(); $this->addBefore("new", array("userLogged")); $this->addBefore("show", array("load", "loadPermission", "loadComments")); $this->addBefore("create", array("userLogged")); $this->addBefore("createView", array("userLogged")); $this->addBefore("updatePermissions", array("userLogged", "load", "loadPermission")); $this->addBefore("delete", array("userLogged", "userAuthorized", "load", "loadPermission")); $this->addBefore("addFiles", array("userLogged", "load", "loadPermission")); $this->addBefore("addComment", array("userLogged", "load", "loadPermission")); $this->addBefore("deleteComment", array("userLogged", "load", "loadPermission")); $this->addBefore("comments", array("load", "loadPermission", "loadComments")); $this->addBefore("deleteFile", array("userLogged", "load", "loadPermission", "loadFile")); $this->addBefore("showFile", array("load", "loadPermission", "loadFile")); $this->addBefore("getFileContent", array("load", "loadPermission", "loadFile")); $this->addBefore("filesList", array("load", "loadPermission")); $this->addBefore("settings", array("userLogged", "load", "loadPermission")); $this->addBefore("update", array("userLogged", "load", "loadPermission")); $this->addBefore("updateFile", array("userLogged", "load", "loadPermission", "loadFile")); $this->data["fileExtensionAccept"] = array("txt", "php", "html", "css", "scss", "phtml", "js", "xml", "json", "yaml", "yml", "htm", "xml", "c", "cpp", "h", "class", "dist"); }
function __construct() { parent::__construct(); $this->authService = App::getContainer()->get('auth'); }
public function __construct(IShopData $shopData) { parent::__construct($shopData); }
public function rules() { return array_merge(parent::rules(), ['index' => ['response_type' => 'text/html', 'roles' => [Controller::ALL]], 'login' => ['response_type' => 'text/html', 'roles' => [Controller::ALL]], 'logout' => ['response_type' => 'text/html', 'roles' => [Controller::ALL], 'methods' => ['post']], 'signUp' => ['response_type' => 'text/html', 'roles' => [Controller::ALL]], 'search' => ['response_type' => 'text/html', 'roles' => [Controller::ALL]], 'ajaxSearch' => ['response_type' => 'application/json', 'roles' => [Controller::ALL]]]); }
public function run() { BaseController::ControllerSeeker(self::$controller, self::$action, self::$parameters); }
public function __construct(TagRepositoryInterface $tags) { parent::__construct(); $this->beforeFilter('auth'); $this->tags = $tags; }
public function __construct(IShopData $shopData, IRoleProvider $roleProvider) { parent::__construct($shopData); $this->roleProvider = $roleProvider; }
/** * Create a new TagsController instance. * * @param \App\Repositories\TagRepositoryInterface $tags */ public function __construct(TagRepositoryInterface $tags) { parent::__construct(); $this->tags = $tags; }
/** * Construct * * @param Application $app */ public function __construct(Application $app) { parent::__construct($app); $this->twig = $app['twig']; $this->debug = $app['debug']; }
/** * Create a new HomeController instance. * * @param \Tricks\Repositories\TrickRepositoryInterface $tricks * * @return void */ public function __construct(TrickRepositoryInterface $tricks) { parent::__construct(); $this->tricks = $tricks; }
public function __construct() { parent::__construct(); $this->postsRepo = App::getContainer()->get("postsRepository"); $this->ratingService = App::getContainer()->get("rating"); }
/** * Constructor * * @param Application $app */ public function __construct(Application $app) { parent::__construct($app); // $this->_iniRoutes(); }
public function __construct() { parent::__construct(); $this->data["items"] = null; }
/** * Create a new UsersController instance. * * @param \Tricks\Repositories\UserRepositoryInterface $users * * @return void */ public function __construct(UserRepositoryInterface $users) { parent::__construct(); $this->users = $users; }
/** * Public constructor */ public function __construct() { parent::__construct(); $this->filesModel = new FilesModel(); }
/** * Constructor * * @param Application $app */ public function __construct(Application $app) { parent::__construct($app); }
/** * Create a BaseController instance. * * @return void */ public function __construct() { parent::__construct(); $this->beforeFilter('auth'); }
/** * Create a new CategoriesController instance. * * @param \App\Repositories\CategoryRepositoryInterface $categories */ public function __construct(CategoryRepositoryInterface $categories) { parent::__construct(); $this->categories = $categories; }
/** * Create a new SitemapController instance. * * @param \Tricks\Services\Sitemap\Builder $builder * * @return void */ public function __construct(Builder $builder) { parent::__construct(); $this->builder = $builder; }