code: public function generate()
  	{
  		/** @var PageModel $objPage */
  		global $objPage;
  
  		$obj404 = $this->prepare();
  		$objPage = $obj404->loadDetails();
  
  		/** @var PageRegular $objHandler */
  		$objHandler = new $GLOBALS['TL_PTY']['regular']();
  
  		header('HTTP/1.1 404 Not Found');
  		$objHandler->generate($objPage);
  	}
docs: Generate an error 404 page