I understand now. No, you cannot customise this; the underscore is
hard-coded. See Inflector::humanize() and Inflector::underscore() (in
the Utility directory of the libs).
But is it so bad to have to create routes?
On Sat, Aug 25, 2012 at 11:14 AM, Mohammad Naghavi <mohamnag@gmail.com> wrote:
> thanks for the response it works, however I have to define a routing rule
> per controller. but this is not a need in case I use underscores, I meant if
> there is a way to automate hyphens also like underscores?
>
> regards,
> Mohammad
> ________________________________________
> PHP & ASP .Net 3.5 web developer
> Java & C# desktop developer
> www.mohamnag.com
>
>
>
> On Sat, Aug 25, 2012 at 12:19 PM, Salines <nikola.paradzik@gmail.com> wrote:
>>
>>
>>> I mean for example the following has to generate a valid URL to
>>> MyController:
>>> $this->Html->link('some title', array('controller'=>'my-controller'));
>>>
>>> but what I get is an error that says the My-controller has to be created.
>>> i.e. it does not recognize the existing MyController. can it be done in
>>> behaviour?
>>
>>
>> in the your view.ctp
>>
>> $this->Html->link('some title', array('controller'=>'MyController',
>> 'action'=>'view', $id);
>>
>> in the app/Config/routes.php
>>
>> Router::connect('/my-controller/show-my-favorites/*', array('controller'
>> => 'MyController', 'action' => 'view'));
>>
>>
>> Output links like
>>
>> <a href="/my-controller/show-my-favorites/19">some title</a>
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com.
>> To unsubscribe from this group, send email to
>> cake-php+unsubscribe@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>>
>>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
Saturday, August 25, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment