From:
http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
A small change has also been done to routing params. Routed params
should now only consist of alphanumeric chars, - and _ or /[A-Z0-9-_+]
+/.
- params are all alphanumeric
but Not Working
Router::connect(
'/:title-o-:option',
array('controller' => 'pages', 'action' => 'produtos'),
array(
'pass' => array('option'),
'option' => '.*',
)
);
but if you substitute - with _ it works
Working:
Router::connect(
'/:title_o_:option',
array('controller' => 'pages', 'action' => 'produtos'),
array(
'pass' => array('option'),
'option' => '.*',
)
);
this could be a solution if the web pages was not already indexed in
search engines with - on URL ....
_ char should be accepted
Is this a bug? or am i missing something here?
On May 25, 11:55 am, PaulMan <[email protected]> wrote:
> Router::connect(
> '/:slug-n-:id',
> array('controller' => 'pages', 'action' => 'news_detail'),
> array(
> 'pass' => array('id', 'slug'),
> 'slug' => '.*',
> 'id' => '[\d]+'
> )
> );
>
> is this correct in CakePHP 1.3 ? it generates this error
>
> Warning (2): preg_match() [function.preg-match]: Compilation failed:
> syntax error in subpattern name (missing terminator) at offset 13 [CORE
> \cake\libs\router.php, line 1397]
>
> in checked router.php line 1397 , and $route var third parameter to
> preg_match is missing !!!!
>
> function parse($url) {
> if (!$this->compiled()) {
> $this->compile();
> }
> if (!preg_match($this->_compiledRoute, $url, $route)) {
> return false;
> } else {
> .........................................
>
> help please!!!
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> athttp://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en