Phalcon\Utils\PrettyExceptions::showFileFragment PHP Метод

showFileFragment() публичный Метод

Set if only the file fragment related to the exception must be shown instead of the complete file
public showFileFragment ( boolean $showFileFragment )
$showFileFragment boolean
    public function showFileFragment($showFileFragment)
    {
        $this->_showFileFragment = $showFileFragment;
    }

Usage Example

 /**
  * @param      $exceptionOrCode
  * @param null $message
  * @param null $file
  * @param null $line
  *
  * @return bool
  */
 protected function getTemplate($exceptionOrCode, $message = NULL, $file = NULL, $line = NULL)
 {
     if ($exceptionOrCode instanceof \Exception) {
         $message = $exceptionOrCode->getMessage();
         $file = $exceptionOrCode->getFile();
         $line = $exceptionOrCode->getLine();
     }
     $prettyPrinter = new PrettyExceptions();
     $prettyPrinter->showFiles(TRUE);
     $prettyPrinter->showFileFragment(TRUE);
     $prettyPrinter->setTheme('night');
     ob_start();
     ob_start();
     $prettyPrinter->handleError(-1, $message, $file, $line);
     return $this->handleTemplate();
 }