<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Promet CakePHP Source &#187; html helper</title>
	<atom:link href="http://cakephp.prometsupport.com/tag/html-helper/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakephp.prometsupport.com</link>
	<description></description>
	<lastBuildDate>Mon, 23 Feb 2009 08:03:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Convenient $html-&gt;link()</title>
		<link>http://cakephp.prometsupport.com/2008/convenient-html-link/</link>
		<comments>http://cakephp.prometsupport.com/2008/convenient-html-link/#comments</comments>
		<pubDate>Wed, 28 May 2008 11:41:48 +0000</pubDate>
		<dc:creator>rachel</dc:creator>
				<category><![CDATA[CakePHP 1.2]]></category>
		<category><![CDATA[Helpers]]></category>
		<category><![CDATA[html helper]]></category>
		<category><![CDATA[route]]></category>

		<guid isPermaLink="false">http://cakephp.prometsupport.com/2008/05/28/convenient-html-link/</guid>
		<description><![CDATA[I made this quick helper that extends Html Helper. While creating my very first plugin for cakephp 1.2, I decided to use Route so that I can save some space and time typing long controller names. Here is the sample code in my views: echo $html->link( 'Link Test', array( 'controller' => 'long_controller_name', 'actions' => 'index', [...]]]></description>
			<content:encoded><![CDATA[<p>I made this quick helper that extends Html Helper. While creating my very first plugin for cakephp 1.2, I decided to use Route so that I can save some space and time typing long controller names. Here is the sample code in my views:</p>
<p><code lang="php"><br />
echo $html->link( 'Link Test',<br />
                  array(<br />
                    'controller' => 'long_controller_name',<br />
                    'actions' => 'index',<br />
                    'plugin' => 'long_plugin_name'<br />
                  )<br />
                );</code></p>
<p>I am a lazy typist and so I wanted to be able to use shortcut names for the array keys such as the following:</p>
<pre>
c = controller
a = action
p = plugin

OR use numbers

0 = controller
1 = action
2 = plugin
</pre>
<p>I couldn&#8217;t find in the <a href="http://bakery.cakephp.org">bakery</a> any solution so I decided to create my own Html helper. Here is how you can install it:</p>
<p>First, add <a href='http://cakephp.prometsupport.com/wp-content/uploads/2008/05/xhtmlphphelper.txt' title='XHTML Helper'>this file</a> to your helpers folder located in<br />
<code>/cakedir/app/views/helpers/</code><br />
<a href='http://cakephp.prometsupport.com/wp-content/uploads/2008/05/xhtmlphphelper.txt' title='XHTML Helper'>Download XHTML Helper</a></p>
<p>Then, in your controller file, include the <strong>Xhtml</strong> to your helpers list. Example</p>
<p><code lang="php"><br />
class MyController extends AppController {<br />
  ...<br />
  var $helpers = array( 'Xhtml' );<br />
  ...<br />
}<br />
</code></p>
<p>That&#8217;s it. You can use it by doing the following:</p>
<p><code lang="php"><br />
echo $xhtml->link( 'Link Test',<br />
                    array(<br />
                        'c' => 'long_controller_name',<br />
                        'a' => 'index',<br />
                        'p' => 'long_plugin_name'<br />
                    )<br />
                 );</code></p>
<p>OR</p>
<p><code lang="php"><br />
echo $xhtml->link( 'Link Test',<br />
                    array( 'long_controller_name',<br />
	                       'index',<br />
	                       'long_plugin_name'<br />
	                )<br />
                 );</code></p>
<p>Take note of using <strong>xhtml</strong> instead of <strong>html</strong>. I hope I don&#8217;t mislead anyone for using the name XHTML <img src='http://cakephp.prometsupport.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> . I just want an extended HTML helper.</p>
<div class="notice">
<strong>[Update]:</strong> update code <a href="/2008/07/11/tip-use-cakephp-routeurl-for-your-urls/">here</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://cakephp.prometsupport.com/2008/convenient-html-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
