コード例 #1
0
ファイル: Templates.php プロジェクト: marvinlabs/baobab
 /**
  * For themes properly structured, we can find the search form template at
  * app/views/parts/misc/search-form.php. We'll also try a blade template if possible. In order, the templates which
  * will be tried will be:
  *
  * /my-theme/app/views/parts/misc/search-form.blade.php
  * /my-theme/app/views/parts/search-form.blade.php
  * /my-theme/app/views/parts/misc/search-form.php
  * /my-theme/app/views/parts/search-form.php
  * /my-theme/searchform.php
  *
  * @param $form The search form
  *
  * @return string
  */
 public function suggestMoreSearchFormTemplates($form)
 {
     ob_start();
     // Try a blade template first and if not found, try standard PHP templates
     $template = Views::pickView(array('parts.misc.search-form', 'parts.search-form'));
     if ($template != null) {
         Views::render(Baobab::blade()->view()->make($template));
     } else {
         locate_template(array('/app/views/parts/misc/search-form.php', '/app/views/parts/search-form.php', 'searchform.php'), true, false);
     }
     $form = ob_get_clean();
     return $form;
 }
コード例 #2
0
ファイル: DefaultController.php プロジェクト: kreapress/balsa
 /**
  * Display the 404 page
  *
  * @return View The view to be shown to the user
  */
 public function error404()
 {
     return Baobab::blade()->view()->make('templates.404');
 }