예제 #1
0
 /**
  * Displays the source code of the given action name.
  *
  * @param  string $actionName  Name of the controller's action method.
  */
 public function doDebugViewAction($actionName)
 {
     if (RPG::config('debug') === true and strpos($actionName, 'do') === 0) {
         $method = new ReflectionMethod($this, $actionName);
         $out = '<h2>' . $method->getDeclaringClass()->getName() . "::{$actionName}()</h2>\n" . '<a href="' . RPG::url('*/debug-list-actions') . '">&laquo; Action List</a><br /><br />';
         $start = $method->getStartLine() - 1;
         $end = $method->getEndLine();
         $file = file($method->getFileName());
         $lines = array_slice($file, $start, $end - $start);
         $out .= "<pre>\n    " . str_replace("\t", '    ', $method->getDocComment()) . "\n";
         foreach ($lines as $line) {
             $out .= htmlentities(str_replace("\t", '    ', $line));
         }
         $out .= '</pre>';
         RPG::view()->setLayout('layouts/empty.php')->setContent($out);
     }
 }
예제 #2
0
파일: View.php 프로젝트: laiello/crindigan
 /**
  * Sends a redirect to the browser.
  * 
  * @param  string $path
  * @param  array  $query
  * @see    RPG::url()
  */
 public function redirect($path, array $query = array())
 {
     header('Location: ' . RPG::url($path, $query));
     exit;
 }
예제 #3
0
 /**
  * Returns an escaped internal URL given the path as
  * "controller/action/param1/.../paramN" and an array of elements to
  * include in the query string.
  *
  * @param  string $path
  * @param  array  $query
  * @return string Escaped URL.
  * @see    RPG::url()
  */
 public function url($path, array $query = array())
 {
     return $this->escape(RPG::url($path, $query), true);
 }