getLocale() public method

public getLocale ( ) : string
return string
コード例 #1
0
 /**
  * @param ContentRouteInterface $contentRoute
  * @param $path
  * @param $content
  * @return Route
  */
 public static function generateRoute(ContentRouteInterface $contentRoute, $path, $content)
 {
     $template = new Template(array('template' => $contentRoute->getTemplate()));
     $defaults = array('route_params' => '', Route::LOCALE => $contentRoute->getLocale(), RouteObjectInterface::CONTROLLER_NAME => $contentRoute->getController(), RouteObjectInterface::TEMPLATE_NAME => $template, RouteObjectInterface::CONTENT_OBJECT => $content);
     return new Route($path, $defaults);
 }
コード例 #2
0
 /**
  * @param ContentRouteInterface $var
  * @return bool
  */
 protected function filterByLocale(ContentRouteInterface $var)
 {
     if ($this->request) {
         return $var->getLocale() == $this->request->getLocale();
     } else {
         return true;
     }
 }