Tuesday, September 3, 2013

Re: Where is the Tool for the Naming Convention Generation

Just used the Inflector::slug() method yesterday. Nice for making URL
safe strings.

Inflector::slug('Hello World');
Output: 'hello_world'

It might be tricky to alter the schema, but you can use custom tables in models.

i.e. You have a 'customer' table, but the proper table name would be
'customers' with a Customer model.

You can can use the same table with the correct model name:

class Customer extends AppModel {
$public $userTable = 'customer';
}

By default CakePHP will Inflector::tableize('Customer') which will
assume the table name is 'customers'.

On Wed, Sep 4, 2013 at 8:45 AM, Matthew Kaufman <mkfmncom@gmail.com> wrote:
> Cool, thanks Simon.
>
> I am trying to explain to someone what the entire point of the
> Inflector was. He is migrating a old MySQL application table schema
> into a new Cake application he is building.
>
> He isn't totally familar with conventions yet and I am trying to refer
> him to useful resources.
>
> In your words, what do you utilize this Inflector tool for? What is the
> best use case for it.
>
> Thanks :)
>
> Sent from my Windows Phone From: Simon Males
> Sent: 9/3/2013 8:41 PM
> To: cake-php@googlegroups.com
> Subject: Re: Where is the Tool for the Naming Convention Generation
> It hasn't seemed to work for me in that last couple of days:
> http://inflector.cakephp.org/
>
> Though here is the library:
> http://book.cakephp.org/2.0/en/core-utility-libraries/inflector.html
>
> On Wed, Sep 4, 2013 at 7:20 AM, Matthew Kaufman <mkfmncom@gmail.com> wrote:
>> Hey,
>>
>> I was in IRC once and someone named an inflector type tool which generated
>> the proper Model, Controller, View naming according to proper Conventions.
>> It was on a sub-domain of cakephp.org; can anyone remind me of this uri?
>>
>>
>> Matthew M. Kaufman
>> CEO, MI2 Holdings LLC.
>>
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscribe@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
> Simon Males
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google
> Groups "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cake-php+unsubscribe@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Simon Males

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: