Example #1
0
<?php

/*
 * Laravel.JpRecipe Router
 */
\Route::when('auth/callback*', 'guest');
\Route::when('auth/login*', 'guest');
\Route::when('auth/logout*', 'auth');
\Route::when('*', 'csrf', ['post']);
\Route::when('webmaster/recipe*', 'post.once', ['post']);
\Route::when('webmaster/category*', 'post.once', ['post']);
\Route::get('faq', function () {
    $title = \Config::get('recipe.title') . "FAQ";
    \View::inject('title', $title);
    return \View::make('home.faq.index');
});
\Route::group(['namespace' => 'App\\Controllers'], function () {
    // for API
    \Route::group(['namespace' => 'Api', 'prefix' => 'api/v1'], function () {
        \Route::resource('recipe', 'RecipeController', ['only' => ['index', 'show']]);
    });
    \Route::group(['namespace' => 'WebMaster', 'before' => 'auth', 'prefix' => 'webmaster'], function () {
        \Route::get('/', ['uses' => 'HomeController@getIndex', 'as' => 'webmaster.index']);
        // recipe
        \Route::controller('recipe', 'RecipeController', ['getShow' => 'webmaster.recipe.show', 'getList' => 'webmaster.recipe.list', 'getForm' => 'webmaster.recipe.form', 'postConfirm' => 'webmaster.recipe.confirm', 'postApply' => 'webmaster.recipe.apply']);
        // category
        \Route::controller('category', 'CategoryController', ['getShow' => 'webmaster.category.show', 'getList' => 'webmaster.category.list', 'getForm' => 'webmaster.category.form', 'postConfirm' => 'webmaster.category.confirm', 'postApply' => 'webmaster.category.apply']);
    });
    //
    \Route::get('search', ['uses' => 'SearchController@getIndex', 'as' => 'search.index']);
    //
 /**
  * @param null $string
  * @return void
  */
 protected function description($string = null)
 {
     $description = $string ? " | {$string}" : null;
     $description = \Config::get('recipe.description_prefix') . $description . " レシピ";
     \View::inject('description', e(str_replace(["\r\n", "\r", "\n"], '', $description)));
 }
Example #3
0
<?php

return array('paths' => array(__DIR__ . '/../views'), 'pagination' => View::inject('common/pagination'));
Example #4
0
 /**
  * This abstraction over the base method injects the skin name
  * and default view data.
  *
  * @param  string  $view
  * @param  array   $data
  * @param  int     $status
  * @param  array   $headers
  * @return \Illuminate\View\View
  */
 public static function view($view, $data = array(), $status = 200, array $headers = array())
 {
     $data = array_merge(View::defaults(), $data);
     return parent::view(View::inject($view), $data, $status, $headers);
 }