public function __construct($opts = []) { parent::__construct($opts); $start = RequestMethods::get('start', date('Y-m-d', strtotime("-1 day"))); $end = RequestMethods::get('end', date('Y-m-d')); $user_id = RequestMethods::get("user_id", null); $this->start = $start; $this->end = $end; $this->user_id = $user_id; }
public function scrape() { $view = $this->getActionView(); $url = RequestMethods::get("link"); if (!$url) { $view->set('error', 'Invalid Request Parameters!!'); } $scraper = new Scraper($url); $view->set('words', $scraper->fetch()); }
| | Register the driver for caching | Other drivers can be used if registered with the factory class | */ $cache = new Cache(); Registry::set("cache", $cache->initialize()); /* |-------------------------------------------------------------------------- | Register Router |-------------------------------------------------------------------------- | | Register the Router class to making sure we get to the right place | */ $router = new Router(array("method" => RequestMethods::server('REQUEST_METHOD'), "url" => RequestMethods::get('url', 'home'))); Registry::set("router", $router); /* |-------------------------------------------------------------------------- | Register Routes |-------------------------------------------------------------------------- | | Register any predefined custom application routes. | Can be used to direct URI to specific controller and/or methods | */ include path('app') . 'routes' . EXT; /* |-------------------------------------------------------------------------- | Route The Incoming Request |--------------------------------------------------------------------------