Lang::load PHP Method

load() public static method

Load the specified language group.
public static load ( string $namespace, string $group, string $locale ) : void
$namespace string
$group string
$locale string
return void
        public static function load($namespace, $group, $locale)
        {
            \Illuminate\Translation\Translator::load($namespace, $group, $locale);
        }

Usage Example

Example #1
0
 public static function run($uri)
 {
     self::$router = new Router($uri);
     self::$db = new DB(Config::get('db.host'), Config::get('db.user'), Config::get('db.password'), Config::get('db.db_name'));
     Lang::load(self::$router->getLanguage());
     $controller_class = ucfirst(self::$router->getController()) . "Controller";
     $controller_method = strtolower(self::$router->getMethodPrefix() . self::$router->getAction());
     $layout = self::$router->getRoute();
     if ($layout == "admin" && Session::get("role") != "admin") {
         if ($controller_method != "admin_login") {
             Router::redirect("/admin/users/login");
         }
     }
     //Calling controller's method
     $controller_object = new $controller_class();
     if (method_exists($controller_object, $controller_method)) {
         $view_path = $controller_object->{$controller_method}();
         $view_object = new View($controller_object->getData(), $view_path);
         $content = $view_object->render();
     } else {
         throw new Exception("Method {$controller_method} does not exist in {$controller_class}");
     }
     $layout_path = VIEWS_PATH . DS . $layout . ".html";
     $layout_view_object = new View(compact('content'), $layout_path);
     echo $layout_view_object->render();
 }
All Usage Examples Of Lang::load