コード例 #1
0
ファイル: route.php プロジェクト: gilyaev/framework-bench
 /**
  * Dump the results of the currently established route.
  *
  * @return void
  */
 protected function route()
 {
     // We'll call the router using the method and URI specified by
     // the developer on the CLI. If a route is found, we will not
     // run the filters, but simply dump the result.
     $route = Router::route(Request::method(), URI::current());
     if (!is_null($route)) {
         var_dump($route->response());
     } else {
         echo '404: Not Found';
     }
 }
コード例 #2
0
ファイル: request.php プロジェクト: bamper/laravel.com
 /**
  * Get the URI for the current request.
  *
  * @return string
  */
 public static function uri()
 {
     return URI::current();
 }
コード例 #3
0
ファイル: url.php プロジェクト: ibrarturi/laravel-tutorial
 /**
  * Get the full URL for the current request.
  *
  * @return string
  */
 public static function current()
 {
     return static::to(URI::current());
 }
コード例 #4
0
ファイル: url.php プロジェクト: ajb/rfpez
 /**
  * Get the full URL for the current request.
  *
  * @return string
  */
 public static function current()
 {
     return static::to(URI::current(), null, false, false);
 }
コード例 #5
0
ファイル: form.php プロジェクト: nshontz/laravel-blog
 /**
  * Determine the appropriate action parameter to use for a form.
  *
  * If no action is specified, the current request URI will be used.
  *
  * @param  string   $action
  * @param  bool     $https
  * @return string
  */
 protected static function action($action, $https)
 {
     $uri = is_null($action) ? URI::current() : $action;
     return HTML::entities(URL::to($uri, $https));
 }
コード例 #6
0
 public static function to_language($language, $reset = false)
 {
     $url = $reset ? URL::home() : URL::to(URI::current());
     if (!in_array($language, Config::get('application.languages'))) {
         return $url;
     }
     $from = '/' . Config::get('application.language') . '/';
     $to = '/' . $language . '/';
     return str_replace($from, $to, $url);
 }
コード例 #7
0
ファイル: laravel.php プロジェクト: gigikiri/masjid-l3
|
*/
Router::register('*', '(:all)', function () {
    return Event::first('404');
});
/*
|--------------------------------------------------------------------------
| Gather The URI And Locales
|--------------------------------------------------------------------------
|
| When routing, we'll need to grab the URI and the supported locales for
| the route so we can properly set the language and route the request
| to the proper end-point in the application.
|
*/
$uri = URI::current();
$languages = Config::get('application.languages', array());
$languages[] = Config::get('application.language');
/*
|--------------------------------------------------------------------------
| Set The Locale Based On The Route
|--------------------------------------------------------------------------
|
| If the URI starts with one of the supported languages, we will set
| the default lagnauge to match that URI segment and shorten the
| URI we'll pass to the router to not include the lang segment.
|
*/
foreach ($languages as $language) {
    if (preg_match("#^{$language}(?:\$|/)#i", $uri)) {
        Config::set('application.language', $language);
コード例 #8
0
ファイル: url.php プロジェクト: jorgesuarezch/laravel3
 /**
  * Get the URL to switch language, keeping the current page or not
  *
  * @param  string  $language  The new language
  * @param  boolean $reset     Whether navigation should be reset
  * @return string             An URL
  */
 public static function to_language($language, $reset = false)
 {
     // Get the url to use as base
     $url = $reset ? URL::home() : URL::to(URI::current());
     // Validate the language
     if (!in_array($language, Config::get('application.languages'))) {
         return $url;
     }
     // Get the language we're switching from and the one we're going to
     $from = '/' . Config::get('application.language') . '/';
     $to = '/' . $language . '/';
     return str_replace($from, $to, $url);
 }
コード例 #9
0
ファイル: layla.php プロジェクト: reith2004/components
 public function search()
 {
     return Form::open(URI::current(), 'GET') . Form::text('q', null, array('class' => 'search')) . Form::close();
 }