コード例 #1
0
ファイル: Hello.php プロジェクト: 4d47/php-start
 public function render()
 {
     switch ($this->format) {
         case 'json':
             header('Content-Type: application/json');
             echo json_encode($this);
             break;
         case 'html-part':
             static::$layout = false;
             parent::render();
             break;
         case 'html':
             throw new \Http\MovedPermanently(static::link($this->name));
         default:
             parent::render();
     }
 }
コード例 #2
0
ファイル: Template.php プロジェクト: mecrudr/bulletphp
 /**
  * Load and return new view for partial
  *
  * @param string $template Template file to use
  * @param array $vars Variables to pass to partial
  * @return Bullet\View\Template
  */
 public function partial($template, array $vars = array())
 {
     $tpl = new static($template, $vars);
     return $tpl->layout(false);
 }
コード例 #3
0
ファイル: page.php プロジェクト: TorbenKoehn/lok
 public static function layout($layout = null)
 {
     if ($layout !== null) {
         static::$layout = $layout;
     }
     return static::$layout;
 }
コード例 #4
0
ファイル: Application.php プロジェクト: ale88andr/Nova
 /**
  * Set application html layout.
  *
  * @param bool|string $layout HTML layout name
  * @return void
  */
 public static function setLayout($layout = false)
 {
     static::$layout = $layout ? $layout : 'application';
 }
コード例 #5
0
ファイル: View.php プロジェクト: ramee/alien-framework
 public static function setLayout($name)
 {
     static::$layout = $name;
 }