#5974: Routing error
---------------------------------------+------------------------------------
Reporter: ecamaj | Owner:
Type: Bug | Status: closed
Priority: Medium | Milestone: 1.2.x.x
Component: General | Version: 1.2 Final
Severity: Normal | Resolution: worksforme
Keywords: routes, routing, index | Php_version: PHP 5
Cake_version: |
---------------------------------------+------------------------------------
Changes (by nate):
* status: reopened => closed
* resolution: => worksforme
Comment:
Since you're talking about two different things (URLs that get generated,
and URLs that get parsed), I'm still not entirely sure what you're asking,
however, I've created a test case based on your explanation of the
problem, for you to use as a point of reference:
{{{
/**
* Tests that route parameters with default null values don't eat things
they're not supposed to
*
* @access public
* @return void
*/
function testRoutesWithDefaultNullValues() {
Router::connect(
'/:category',
array('controller' => 'categories', 'action' =>
'view', 'category' => null),
array('category' => '[a-z]+')
);
$result = Router::url(array('controller' => 'forum',
'category' => 'foo'));
$expected = '/forum/index/category:foo';
$this->assertEqual($result, $expected);
$result = Router::url(array(
'controller' => 'categories', 'action' => 'view',
'category' => 'foo'
));
$expected = '/foo';
$this->assertEqual($result, $expected);
$result = Router::url(array('controller'=>'forum',
'action' => 'index'));
$expected = '/forum/';
$this->assertEqual($result, $expected);
}
}}}
[[BR]]
All the tests pass.
[[BR]][[BR]]
If this is still an issue for you, perhaps you could provide some
additional clarification, ideally in the form of a step-by-step code
example, what the result of the example is, and what you expected it to
be. Thanks.
--
Ticket URL: <https://trac.cakephp.org/ticket/5974#comment:4>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets 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/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---