Re: What are your personal conventions for Helper names and using helper classes?
That’s a neat little solution. I always enjoy getting dirty forking the libs/ directory myself. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: What are your personal conventions for Helper names and using helper classes?
Thanks euromark. You, and the other cakers below confirmed that I’m not insane. The most important thing I’ve gleaned from this thread is that I really need to start following the roadmap (and migration guides) for 2 and beyond to get a better idea of the direction the development team are taking. I’d be interested to see how soon $helper is removed in favour of $this->Helper in CakePHP 2 - if it hasn’t already been considered and documented. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: What are your personal conventions for Helper names and using helper classes?
Connrs: It is best practice to use $this->Helper and I believe you may run into some issues if you don't do it with some helpers in Cake1.3.x. -DK On Jan 21, 9:53 am, connrs wrote: > Hi guys > > I suppose this is my first ever post on any CakePHP related forum/group so > get the unicorns and badger porn out. I've been actively using CakePHP since > 1.1 and have generally beaten and thrashed the framework into doing what I > liked until progressively it has become the shiny framework of today. > > As I've refactored and refactored over and over, Cake has finally beaten and > thrashed me into better use of Behavior, Component and Helper; I use those > three so much now to keep my code tidy and help make testing manageable. > > These days, I find that there are times I want to name a helper to match the > model when working in views. I feel that models named Invoice suit an > Invoice helper more than concocting weakly linked names; yet, in the past > I've often mashed up the oddest of names so that I can avoid variable > collisions. I, personally, find this method much more MVC (I've seen this in > my occasional expeditions into RoR). > * > * > *TLDR;* > * > * > Since 1.3, have you begun refactoring to take advantage of $this->Helper or > have you continued to make use of $helper and used creative naming to get > around things? > *I guess I'm just trying to gauge whether or not I'm personally taking the > right path with $this->Helper over $helper* -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: What are your personal conventions for Helper names and using helper classes?
with a little hack you can already disable $html for the object... http://www.dereuromark.de/2010/09/12/neccessary-core-hacks-cake-1-3/ On 22 Jan., 16:31, "clearflysyst...@googlemail.com" wrote: > I have to agree $this->Helper. > > It makes more sense when reading your code that you're referencing a > Helper Class and not a local variable you have set somewhere else in > your code. > Also i quite often have for loops where i'm building up a html string > for output and $html would be the logical variable name but then you > get the clash. > > So i hope Cake Devs intend to remove $html etc in 2.0, > > On Jan 21, 3:20 pm, euromark wrote: > > > > > > > > > of course 100% > > $this->Helper > > > a) cleaner > > b) fit for 2.0 > > > :) > > > On 21 Jan., 15:53, connrs wrote: > > > > Hi guys > > > > I suppose this is my first ever post on any CakePHP related forum/group so > > > get the unicorns and badger porn out. I've been actively using CakePHP > > > since > > > 1.1 and have generally beaten and thrashed the framework into doing what I > > > liked until progressively it has become the shiny framework of today. > > > > As I've refactored and refactored over and over, Cake has finally beaten > > > and > > > thrashed me into better use of Behavior, Component and Helper; I use those > > > three so much now to keep my code tidy and help make testing manageable. > > > > These days, I find that there are times I want to name a helper to match > > > the > > > model when working in views. I feel that models named Invoice suit an > > > Invoice helper more than concocting weakly linked names; yet, in the past > > > I've often mashed up the oddest of names so that I can avoid variable > > > collisions. I, personally, find this method much more MVC (I've seen this > > > in > > > my occasional expeditions into RoR). > > > * > > > * > > > *TLDR;* > > > * > > > * > > > Since 1.3, have you begun refactoring to take advantage of $this->Helper > > > or > > > have you continued to make use of $helper and used creative naming to get > > > around things? > > > *I guess I'm just trying to gauge whether or not I'm personally taking the > > > right path with $this->Helper over $helper* -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: What are your personal conventions for Helper names and using helper classes?
I have to agree $this->Helper. It makes more sense when reading your code that you're referencing a Helper Class and not a local variable you have set somewhere else in your code. Also i quite often have for loops where i'm building up a html string for output and $html would be the logical variable name but then you get the clash. So i hope Cake Devs intend to remove $html etc in 2.0, On Jan 21, 3:20 pm, euromark wrote: > of course 100% > $this->Helper > > a) cleaner > b) fit for 2.0 > > :) > > On 21 Jan., 15:53, connrs wrote: > > > Hi guys > > > I suppose this is my first ever post on any CakePHP related forum/group so > > get the unicorns and badger porn out. I've been actively using CakePHP since > > 1.1 and have generally beaten and thrashed the framework into doing what I > > liked until progressively it has become the shiny framework of today. > > > As I've refactored and refactored over and over, Cake has finally beaten and > > thrashed me into better use of Behavior, Component and Helper; I use those > > three so much now to keep my code tidy and help make testing manageable. > > > These days, I find that there are times I want to name a helper to match the > > model when working in views. I feel that models named Invoice suit an > > Invoice helper more than concocting weakly linked names; yet, in the past > > I've often mashed up the oddest of names so that I can avoid variable > > collisions. I, personally, find this method much more MVC (I've seen this in > > my occasional expeditions into RoR). > > * > > * > > *TLDR;* > > * > > * > > Since 1.3, have you begun refactoring to take advantage of $this->Helper or > > have you continued to make use of $helper and used creative naming to get > > around things? > > *I guess I'm just trying to gauge whether or not I'm personally taking the > > right path with $this->Helper over $helper* > > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: What are your personal conventions for Helper names and using helper classes?
of course 100% $this->Helper a) cleaner b) fit for 2.0 :) On 21 Jan., 15:53, connrs wrote: > Hi guys > > I suppose this is my first ever post on any CakePHP related forum/group so > get the unicorns and badger porn out. I've been actively using CakePHP since > 1.1 and have generally beaten and thrashed the framework into doing what I > liked until progressively it has become the shiny framework of today. > > As I've refactored and refactored over and over, Cake has finally beaten and > thrashed me into better use of Behavior, Component and Helper; I use those > three so much now to keep my code tidy and help make testing manageable. > > These days, I find that there are times I want to name a helper to match the > model when working in views. I feel that models named Invoice suit an > Invoice helper more than concocting weakly linked names; yet, in the past > I've often mashed up the oddest of names so that I can avoid variable > collisions. I, personally, find this method much more MVC (I've seen this in > my occasional expeditions into RoR). > * > * > *TLDR;* > * > * > Since 1.3, have you begun refactoring to take advantage of $this->Helper or > have you continued to make use of $helper and used creative naming to get > around things? > *I guess I'm just trying to gauge whether or not I'm personally taking the > right path with $this->Helper over $helper* -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php