public static function _HookCatch404(View $view) {
		if (REL_REQUEST_PATH == '/') {
			// Index page was requested! ^_^

			// Switch the view's controller with this one.
			$newcontroller = new self();
			// This will allow the system view to be redirected, since I cannot return anything other than a true/false in hook calls.
			$newcontroller->overwriteView($view);
			$view->baseurl = '/GettingStarted';
			$newcontroller->index();

			// Prevent event propagation!
			return false;
		}
	}
Example #2
0
 /**
  *  Parse and HTML string.
  *
  *  @param string $html - source of some HTML document
  *  @param string $url  - OPTIONAL location of the document. Used for relative URLs inside the document.
  *
  *  @return hQuery $doc
  */
 public static function fromHTML($html, $url = NULL)
 {
     $index_time = microtime(true);
     if (isset(self::$_mockup_class)) {
         $doc = new self::$_mockup_class($html, false);
     } else {
         $doc = new self($html, false);
     }
     if ($url) {
         $doc->location($url);
     }
     $doc->index();
     $index_time = microtime(true) - $index_time;
     $doc->index_time = $index_time * 1000;
     return $doc;
 }
Example #3
0
 public static function error404()
 {
     $c = new self('404 Page Not Found');
     $c->index();
     exit;
 }