CakePHP Cookbook Documentation 5.xmatching patterns for route elements ->setPatterns([ 'slug' => '[a-z0-9-_]+', 'lang' => 'en|fr|es', ]) // Also allow JSON file extensions ->setExtensions(['json']) // Set lang to be a persistent => 'Languages', 'action' => 'view', 'es']); into this: Router::url(['plugin' => 'MyPlugin', 'controller' => 'Locations', 'action' => 'index', 'language' => 'es']); Warning If you are using the caching Check whether a specific language is accepted: $acceptsSpanish = $this->request->acceptLanguage('es-es'); Reading Cookies Request cookies can be read through a number of methods: // Get the cookie value0 码力 | 1080 页 | 939.39 KB | 1 年前3
CakePHP Cookbook Documentation 5.xthe matching patterns for route elements ->setPatterns([ 'slug' => '[a-z0-9-_]+', 'lang' => 'en|fr|es', ]) // Also allow JSON file extensions ->setExtensions(['json']) // Set lang to be a persistent following route: Router::url(['plugin' => 'MyPlugin', 'controller' => 'Languages', 'action' => 'view', 'es ˓→']); Creating Persistent URL Parameters 161 CakePHP Cookbook Documentation, Release 5.x into Router::url(['plugin' => 'MyPlugin', 'controller' => 'Locations', 'action' => 'index', ˓→'language' => 'es']); Warning: If you are using the caching features of routing-middleware you must define the URL filters0 码力 | 848 页 | 2.53 MB | 1 年前3
CakePHP Cookbook 3.x
matching patterns for route elements ->setPatterns([ 'slug' => '[a-z0-9-_]+', 'lang' => 'en|fr|es', ]) // Also allow JSON file extensions ->setExtensions(['json']) // Set lang to be a persistent => 'Languages', 'action' => 'view', 'es']); into this: Router::url(['plugin' => 'MyPlugin', 'controller' => 'Locations', 'action' => 'index', 'language' => 'es']); Warning If you are using the caching Check whether a specific language is accepted: $acceptsSpanish = $this->request->acceptLanguage('es-es'); Cookies Request cookies can be read through a number of methods: // Get the cookie value, or0 码力 | 1244 页 | 1.05 MB | 1 年前3
CakePHP Cookbook 3.x
the matching patterns for route elements ->setPatterns([ 'slug' => '[a-z0-9-_]+', 'lang' => 'en|fr|es', ]) (continues on next page) 238 Chapter 8. Routing CakePHP Cookbook Documentation, Release 3.10 'Languages', 'action' => 'view', 'es ˓→']); into this: Router::url(['plugin' => 'MyPlugin', 'controller' => 'Locations', 'action' => 'index', ˓→'language' => 'es']); Warning: If you are using the Check whether a specific language is accepted: $acceptsSpanish = $this->request->acceptLanguage('es-es'); Cookies Request cookies can be read through a number of methods: // Get the cookie value, or0 码力 | 967 页 | 2.80 MB | 1 年前3
CakePHP Cookbook 4.x
matching patterns for route elements ->setPatterns([ 'slug' => '[a-z0-9-_]+', 'lang' => 'en|fr|es', ]) // Also allow JSON file extensions ->setExtensions(['json']) // Set lang to be a persistent => 'Languages', 'action' => 'view', 'es']); into this: Router::url(['plugin' => 'MyPlugin', 'controller' => 'Locations', 'action' => 'index', 'language' => 'es']); Warning If you are using the caching Check whether a specific language is accepted: $acceptsSpanish = $this->request->acceptLanguage('es-es'); Reading Cookies Request cookies can be read through a number of methods: // Get the cookie value0 码力 | 1249 页 | 1.04 MB | 1 年前3
CakePHP Cookbook 4.x
the matching patterns for route elements ->setPatterns([ 'slug' => '[a-z0-9-_]+', 'lang' => 'en|fr|es', ]) // Also allow JSON file extensions ->setExtensions(['json']) // Set lang to be a persistent 'Languages', 'action' => 'view', 'es ˓→']); into this: Router::url(['plugin' => 'MyPlugin', 'controller' => 'Locations', 'action' => 'index', ˓→'language' => 'es']); Creating Persistent URL Parameters Check whether a specific language is accepted: $acceptsSpanish = $this->request->acceptLanguage('es-es'); Reading Cookies Request cookies can be read through a number of methods: // Get the cookie value0 码力 | 967 页 | 2.88 MB | 1 年前3
CakePHP Cookbook 2.x
CakeRequest::acceptLanguage(); Check whether a specific language is accepted: CakeRequest::acceptLanguage('es-es'); CakeRequest::param($name) Safely read values in $request->params. This removes the need to call can read translations for a specific locale: // Read the spanish locale data. $this->Post->locale = 'es'; $results = $this->Post->find('first', array( 'conditions' => array('Post.id' => $id) )); //0 码力 | 1096 页 | 958.62 KB | 1 年前3
CakePHP Cookbook 2.x
CakeRequest::acceptLanguage(); Check whether a specific language is accepted: CakeRequest::acceptLanguage('es-es'); CakeRequest::param($name) Safely read values in $request->params. This removes the need to call can read translations for a specific locale: // Read the spanish locale data. $this->Post->locale = 'es'; $results = $this->Post->find('first', array( 'conditions' => array('Post.id' => $id) )); // $results0 码力 | 820 页 | 2.52 MB | 1 年前3
共 8 条
- 1













