Pass a variable to a model construct

2015-10-14 Thread Michael Houghton
My experience of this is only with Cake 2, so I don't know if it is possible in Cake 3, but if it is, please point me in the right direction. I find myself writing model files which pass the same parameters to my methods! For example My "Settings" model might have: public function

Dealing with MASSIVE Model Files

2015-09-09 Thread Michael Houghton
I have some big projects in CakePHP and always follow the Fat Models, Skinny Controllers approach. The issue I have now, is some of my model files are 5000 lines! Is there a better way to decouple code that putting it all into the model files. How could this code be separated into smaller

When Fat Models become too Fat?

2015-09-02 Thread Michael Houghton
Hi All I have always stuck to skinny controllers, fat models, but in some projects, I have noticed my model files are now over 5000 lines long!! I would love to break the code up more so that it isn't all in the main model files. Has anyone given this any thought of a good way to achieve

3.0 $this-Form-model no longer works

2014-07-11 Thread Michael Houghton
In 2.x, one could use $this-Form-model which would show the current model being used by the form. This was very useful when making custom helpers. I notice in 3.0 this no longer works. Is there a way to get the current form model somehow in 3.0? -- Like Us on FaceBook

3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
I am using the 3.0 Tree Behavior. I have the following from the docs: $pages = $this-Pages-find('treeList'); http://book.cakephp.org/3.0/en/core-libraries/behaviors/tree.html This just doesn't feel right. It isn't returning a list at all. Should I be doing something else, like: $pages =

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
Hey Jose Sure thing. This seems like a similar issue that I had with: $this-Models-findByField($name)-first(); If you recall, I missed the - first() and was trying: $this-Models-findByField($name); Which just gives a whole lot of data on the schema. With the tree behavior, I am calling:

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
Thanks Jose - that seems to be it! It might be worth updating the Tree docs to show this. Unfortunately, that is still giving me the error: *Error: * Function name must be a string *File* /home/michael/public_html/bettornet/vendor/cakephp/cakephp/src/Collection/Iterator/TreePrinter.php

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
Hey Jose Here it is: https://gist.github.com/cakecoded/59511a440dfb9c5c7628 On Friday, July 11, 2014 12:44:56 PM UTC+1, José Lorenzo wrote: Can you gist your full code, I have no idea what that error is. On Friday, July 11, 2014 11:49:40 AM UTC+2, Michael Houghton wrote: Thanks Jose

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: 3.0 - Removal of JS Helper

2014-06-16 Thread Michael Houghton
Hey Mark - it is super handy at times! I've used it recently for - Ajax Pagination Ajax Links Multiple select boxes where the options change depending on above selections. I recently used the JS helper for the final Toptal exam question and completed the test site in 5 hours with it - most

Re: Cake 2.5.1 Extremely Slow With MSSQL?

2014-06-15 Thread Michael Houghton
I suspect this is a MYSQL setting. Out if interest, have you tried version 2.4 or below? -- 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

3.0 - Removal of JS Helper

2014-06-15 Thread Michael Houghton
It appears that the JS helper has been removed from CakePHP 3. I was just wondering why this was, and how things like Ajax Pagination and other handy JS functions will be handled going forward. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter