<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: An idea for hacking core helpers</title>
	<atom:link href="http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Sat, 13 Mar 2010 06:19:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-135768</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Fri, 04 Sep 2009 14:37:24 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-135768</guid>
		<description>@David: Clever idea. Thanks for sharing!</description>
		<content:encoded><![CDATA[<p>@David: Clever idea. Thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Cournoyer</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-135701</link>
		<dc:creator>David Cournoyer</dc:creator>
		<pubDate>Thu, 03 Sep 2009 04:01:24 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-135701</guid>
		<description>What I prefer (for a component but I think its the same for a helper).
&lt;code&gt;
class AppController extends Controller {
	var $components = array(&#039;Session&#039;, &#039;MySession&#039;);
	function constructClasses() {
		parent::constructClasses();
		$this-&gt;Session = $this-&gt;MySession;
	}
class MySessionComponent extends SessionComponent {
	function setFlash($message, $layout = &#039;default&#039;, $params = array(), $key = &#039;flash&#039;) {
		// my override;
	}
}
?&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>What I prefer (for a component but I think its the same for a helper).<br />
<pre><code>class AppController extends Controller {
	var $components = array('Session', 'MySession');
	function constructClasses() {
		parent::constructClasses();
		$this-&gt;Session = $this-&gt;MySession;
	}
class MySessionComponent extends SessionComponent {
	function setFlash($message, $layout = 'default', $params = array(), $key = 'flash') {
		// my override;
	}
}
?&gt;</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Заменяем стандартные хелперы не трогая ядро CakePHP - Программируем на CakePHP</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-114010</link>
		<dc:creator>Заменяем стандартные хелперы не трогая ядро CakePHP - Программируем на CakePHP</dc:creator>
		<pubDate>Fri, 05 Dec 2008 04:41:07 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-114010</guid>
		<description>[...] стандартных хелперов, но сегодня наткнулся на интересный пост на блоге cakebaker&#8217;а и в его обсуждении Admad привел замечательный пример как [...]</description>
		<content:encoded><![CDATA[<p>[...] стандартных хелперов, но сегодня наткнулся на интересный пост на блоге cakebaker&#8217;а и в его обсуждении Admad привел замечательный пример как [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-113187</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 21 Nov 2008 15:03:14 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-113187</guid>
		<description>@cakebaker - re migration - cheers all went smoothly and we don&#039;t switch off the old server till the end of the month anyway. It&#039;s just the sheer bloody tedium of it... It is really boring and you have to concentrate really hard too... luckily most of the domains emails are managed elsewhere which makes it a lot easier...

But anyway, finally got the chance to do a bit of speculative baking and try this out - very easy and very straight forward. I&#039;m going to play around with all the various solutions people have suggested.

Anyway one of these will be a good fit with my original idea. ( which was to see if there was a way of testing the permissions on internal links (i.e. in the admin side of site) so you only see the links to actions / views you are actually allowed to... easy to do with a custom helper but modifying $html-&gt;link means you could retro fit it to any site with very little fuss.)</description>
		<content:encoded><![CDATA[<p>@cakebaker &#8211; re migration &#8211; cheers all went smoothly and we don&#8217;t switch off the old server till the end of the month anyway. It&#8217;s just the sheer bloody tedium of it&#8230; It is really boring and you have to concentrate really hard too&#8230; luckily most of the domains emails are managed elsewhere which makes it a lot easier&#8230;</p>
<p>But anyway, finally got the chance to do a bit of speculative baking and try this out &#8211; very easy and very straight forward. I&#8217;m going to play around with all the various solutions people have suggested.</p>
<p>Anyway one of these will be a good fit with my original idea. ( which was to see if there was a way of testing the permissions on internal links (i.e. in the admin side of site) so you only see the links to actions / views you are actually allowed to&#8230; easy to do with a custom helper but modifying $html-&gt;link means you could retro fit it to any site with very little fuss.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-112986</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 18 Nov 2008 16:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-112986</guid>
		<description>@ADmad: Thanks for your comment and for sharing your approach! It is a bit more cleaner than what I described in the article.</description>
		<content:encoded><![CDATA[<p>@ADmad: Thanks for your comment and for sharing your approach! It is a bit more cleaner than what I described in the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ADmad</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-112961</link>
		<dc:creator>ADmad</dc:creator>
		<pubDate>Tue, 18 Nov 2008 07:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-112961</guid>
		<description>How about this
&lt;code&gt;
// app/app_controller.php
class AppController extends Controller {
    public $view = &#039;Example&#039;;
    public $helpers = array(&#039;Example&#039;);
}
&lt;/code&gt;

&lt;code&gt;
// app/views/example.php
class ExampleView extends View {
    public function &amp;_loadHelpers(&amp;$loaded, $helpers, $parent = null) {
        $loaded = parent::_loadHelpers($loaded, $helpers, $parent);

		if(isset($loaded[&#039;Example&#039;])) {
			$loaded[&#039;Html&#039;] = $loaded[&#039;Example&#039;];
			unset($loaded[&#039;Example&#039;]);
		}
		
        return $loaded;
    }
}
&lt;/code&gt;

I would prefer specifying my helper in the $helpers array instead of all that extra code in overridden _loadHelpers function.</description>
		<content:encoded><![CDATA[<p>How about this<br />
<pre><code>// app/app_controller.php
class AppController extends Controller {
    public $view = 'Example';
    public $helpers = array('Example');
}</code></pre>
<pre><code>// app/views/example.php
class ExampleView extends View {
    public function &amp;_loadHelpers(&amp;$loaded, $helpers, $parent = null) {
        $loaded = parent::_loadHelpers($loaded, $helpers, $parent);

		if(isset($loaded['Example'])) {
			$loaded['Html'] = $loaded['Example'];
			unset($loaded['Example']);
		}
		
        return $loaded;
    }
}</code></pre>
<p>I would prefer specifying my helper in the $helpers array instead of all that extra code in overridden _loadHelpers function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-112612</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 13 Nov 2008 17:02:57 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-112612</guid>
		<description>@John: Good luck with your migration!

@grigri: I don&#039;t know what happened with this feature, it probably got forgotten :&#124;</description>
		<content:encoded><![CDATA[<p>@John: Good luck with your migration!</p>
<p>@grigri: I don&#8217;t know what happened with this feature, it probably got forgotten :|</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: grigri</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-112445</link>
		<dc:creator>grigri</dc:creator>
		<pubDate>Tue, 11 Nov 2008 14:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-112445</guid>
		<description>This has actually been discussed on the google groups, with no definitive solution.

http://groups.google.com/group/cake-php/browse_thread/thread/ecdb16cb39f89ed5

(there are others too)

Nate said that he had implemented it (the alias thing), but not yet put in in the core because it wasn&#039;t test-covered. This was in February &#039;08. I wonder what happened?</description>
		<content:encoded><![CDATA[<p>This has actually been discussed on the google groups, with no definitive solution.</p>
<p><a href="http://groups.google.com/group/cake-php/browse_thread/thread/ecdb16cb39f89ed5" rel="nofollow">http://groups.google.com/group/cake-php/browse_thread/thread/ecdb16cb39f89ed5</a></p>
<p>(there are others too)</p>
<p>Nate said that he had implemented it (the alias thing), but not yet put in in the core because it wasn&#8217;t test-covered. This was in February &#8216;08. I wonder what happened?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-112440</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 11 Nov 2008 13:02:18 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-112440</guid>
		<description>@grigri - I really like your idea from the previous post - to create base helpers that can then be extended would be a nice way to go - it feels like quite an elegant solution if you know what I mean - and I would think be relatively straight forward to implement - plus it wouldn&#039;t need break backward compatability.

Matt&#039;s suggestion (array(’Html’ =&gt; ‘MyHtmlHelper’)) is very similar in a way (although the other way around) , I suppose  MyHtmlHelper could either extend or just override - giving the developer the responsibility / flexibility

@cakebaker - Unfortunately  I haven&#039;t had a chance to try this out yet, I&#039;ve got an exciting week of server migration ahead of me...</description>
		<content:encoded><![CDATA[<p>@grigri &#8211; I really like your idea from the previous post &#8211; to create base helpers that can then be extended would be a nice way to go &#8211; it feels like quite an elegant solution if you know what I mean &#8211; and I would think be relatively straight forward to implement &#8211; plus it wouldn&#8217;t need break backward compatability.</p>
<p>Matt&#8217;s suggestion (array(’Html’ =&gt; ‘MyHtmlHelper’)) is very similar in a way (although the other way around) , I suppose  MyHtmlHelper could either extend or just override &#8211; giving the developer the responsibility / flexibility</p>
<p>@cakebaker &#8211; Unfortunately  I haven&#8217;t had a chance to try this out yet, I&#8217;ve got an exciting week of server migration ahead of me&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: grigri</title>
		<link>http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/comment-page-1/#comment-112427</link>
		<dc:creator>grigri</dc:creator>
		<pubDate>Tue, 11 Nov 2008 10:10:56 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=936#comment-112427</guid>
		<description>It&#039;s a shame none of the core devs have commented on this - I (and I doubt I&#039;m alone) would like to hear if this issue is ever to be resolved within the core; if the idea of renaming core helpers is anathema to cake&#039;s design principles; what methods the core devs use to customize helpers themselves, etc...

Maybe the post wasn&#039;t inflammatory enough? :)</description>
		<content:encoded><![CDATA[<p>It&#8217;s a shame none of the core devs have commented on this &#8211; I (and I doubt I&#8217;m alone) would like to hear if this issue is ever to be resolved within the core; if the idea of renaming core helpers is anathema to cake&#8217;s design principles; what methods the core devs use to customize helpers themselves, etc&#8230;</p>
<p>Maybe the post wasn&#8217;t inflammatory enough? :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
