<?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>PHP Freelancer &#187; CakePHP</title>
	<atom:link href="http://php-freelancer.in/category/cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://php-freelancer.in</link>
	<description></description>
	<lastBuildDate>Mon, 14 May 2012 10:16:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>[CakePHP]How To Call Controller Action or Controller Function From Views Or Any Location</title>
		<link>http://php-freelancer.in/2011/02/23/cakephphow-to-call-controller-action-or-controller-function-from-views-or-any-location/</link>
		<comments>http://php-freelancer.in/2011/02/23/cakephphow-to-call-controller-action-or-controller-function-from-views-or-any-location/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 08:00:49 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Call controller method from view files]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=234</guid>
		<description><![CDATA[Hi Friends, While developing cakePHP web application we get so many problems and difficulties. Some days ago i got one problem in which I wanted to call controller action or controller function from view file. We can&#8217;t directly call controller function in view file. So I have found one function in cakePHP by which we &#8230; <a href="http://php-freelancer.in/2011/02/23/cakephphow-to-call-controller-action-or-controller-function-from-views-or-any-location/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hi Friends, While developing cakePHP web application we get so many problems and difficulties. Some days ago i got one problem in which I wanted to call controller action or controller function from view file. We can&#8217;t directly call controller function in view file. So I have found one function in cakePHP by which we can call any controller method/action/function from any location in cakePHP or from view<span id="more-234"></span>.</p>
<p>requestAction function calls a controller&#8217;s action from any location and returns data from the action. See below :</p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><pre class="brush: php; title: ; notranslate">

$clientdata=$this-&gt;requestAction('/clients/get_client_data/'.$clientid);
</pre>
<p>Above is code by which you can call controller method/action/function get_client_data from any location or view files. If you use above code it means you are calling client controller and calling get_client_data of client controller. Also you can see that I have passed $clientid with URL, $clientid is dynamic client id which we can passed automatically inside for loop to get client data evertime for loop runs.</p>
<p>When this function calls in view it execute get_client_data function and then return result from get_client_data function in $clientdata variable. In this way we can call controller function from any location or from view.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2011/02/23/cakephphow-to-call-controller-action-or-controller-function-from-views-or-any-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable View From Controller Or Controller Function Without View in CakePHP</title>
		<link>http://php-freelancer.in/2010/08/09/disable-view-from-controller-or-controller-function-without-view-in-cakephp/</link>
		<comments>http://php-freelancer.in/2010/08/09/disable-view-from-controller-or-controller-function-without-view-in-cakephp/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 18:52:14 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Disable View From Controller]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=140</guid>
		<description><![CDATA[Hi Friends, today I am going to explain you one simple thing for which I have searched more than one hour. I wanted to make one controller and one function in it which don&#8217;t have view file for it.I have search for it so many times and finally I got it from one forum where &#8230; <a href="http://php-freelancer.in/2010/08/09/disable-view-from-controller-or-controller-function-without-view-in-cakephp/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hi Friends, today I am going to explain you one simple thing for which I have searched more than one hour. I wanted to make one controller and one function in it which don&#8217;t have view file for it.I have search for it so many times and finally I got it from one forum where they write that how can we disable or not include view for controller function<span id="more-140"></span>.</p>
<p>If you want to disable or not render or want to write controller function without view file then below is the one line code by which you can disable view by writing it in function :</p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p><code>$this-&gt;autoRender = false;</code></p>
<p>Just write this line where you want to disable view.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2010/08/09/disable-view-from-controller-or-controller-function-without-view-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Make Link On Image In CakePHP</title>
		<link>http://php-freelancer.in/2010/06/25/how-to-make-link-on-image-in-cakephp/</link>
		<comments>http://php-freelancer.in/2010/06/25/how-to-make-link-on-image-in-cakephp/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 11:35:40 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[make Link on Image in CakePHP]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=116</guid>
		<description><![CDATA[Hi Friends, After long time I am writing post. In this article I will tell you how to make link on image via in cakePHP. Making Link in cakePHP is easy but sometime we have to make link on image so it is little bit tricky, I have tried so much and after trying so &#8230; <a href="http://php-freelancer.in/2010/06/25/how-to-make-link-on-image-in-cakephp/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hi Friends, After long time I am writing post. In this article I will tell you how to make link on image via in cakePHP. Making Link in cakePHP is easy but sometime we have to make link on image so it is little bit tricky, I have tried so much and after trying so many times I found one way to make link on image<span id="more-116"></span>.</p>
<p>Below are the syntax to make link on image.</p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p><code>echo $html-&gt;link($html-&gt;image("user_red_delete.png"), 'javascript:;', array('escape' =&gt; false));</code></p>
<p>In above statement you just have to replace your image path with RED words &#8220;user_red_delete.png&#8221;.</p>
<p>After doing this you will see that your image will have link on itself.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2010/06/25/how-to-make-link-on-image-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP : How To Get Current URL In View In CakePHP</title>
		<link>http://php-freelancer.in/2010/05/08/cakephp-how-to-get-current-url-in-view-in-cakephp/</link>
		<comments>http://php-freelancer.in/2010/05/08/cakephp-how-to-get-current-url-in-view-in-cakephp/#comments</comments>
		<pubDate>Sat, 08 May 2010 17:42:10 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[get current url in view in cakePHP]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=109</guid>
		<description><![CDATA[Hello Friends, Sometimes we want take current URL in cakePHP in view, Today I got current URL for transferring to that URL after log in. I have tried so many things to work it out and finally I got one working way to get current URL in view. We can use $_SERVER variable to get &#8230; <a href="http://php-freelancer.in/2010/05/08/cakephp-how-to-get-current-url-in-view-in-cakephp/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello Friends, Sometimes we want take current URL in cakePHP in view, Today I got current URL for transferring to that URL after log in. I have tried so many things to work it out and finally I got one working way to get current URL in view. We can use $_SERVER variable to get current URL but cakePHP giving its own method to get current URL in view file. It is very easy and it is working perfectly I have used it in my web application and it is working smoothly<span id="more-109"></span>.</p>
<p>So if you want to take current URL in cakePHP view than check out below code :</p>
<p><code>echo Router::url($this-&gt;here, true);</code></p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>This will output current URL. If you want relative path and not full URL than you can do like this :</p>
<p><code>echo $this-&gt;here;</code></p>
<p>By this you can get relative path in the view.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2010/05/08/cakephp-how-to-get-current-url-in-view-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP : How To Disable Site Wide Caching In CakePHP</title>
		<link>http://php-freelancer.in/2010/05/08/cakephp-how-to-disable-site-wide-caching-in-cakephp/</link>
		<comments>http://php-freelancer.in/2010/05/08/cakephp-how-to-disable-site-wide-caching-in-cakephp/#comments</comments>
		<pubDate>Sat, 08 May 2010 16:22:24 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Disable cache in CakePHP]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=106</guid>
		<description><![CDATA[Hello Friends, In this article I will share with you that how to disable site wide caching in CakePHP, CakePHP having cache system So many times we have to turn off or turn off cache system, So we can do it cache disable or enable from core.php file which exists in config folder. Open app/config/core.php &#8230; <a href="http://php-freelancer.in/2010/05/08/cakephp-how-to-disable-site-wide-caching-in-cakephp/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello Friends, In this article I will share with you that how to disable site wide caching in CakePHP, CakePHP having cache system So many times we have to turn off or turn off cache system, So we can do it cache disable or enable from core.php file which exists in config folder<span id="more-106"></span>.</p>
<p>Open app/config/core.php file and try to find</p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p><code>Configure::write('Cache.disable', true);</code></p>
<p>If this code is commented in core.php file that means your cache system is enabled in your site So if you want to disable just remove comments from this code, It will disable site wide cache.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2010/05/08/cakephp-how-to-disable-site-wide-caching-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CakePHP : How To Not Include Layout In A View</title>
		<link>http://php-freelancer.in/2010/05/08/cakephp-how-to-not-include-layout-in-a-view/</link>
		<comments>http://php-freelancer.in/2010/05/08/cakephp-how-to-not-include-layout-in-a-view/#comments</comments>
		<pubDate>Sat, 08 May 2010 14:35:36 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Not to include any layout cakephp]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=100</guid>
		<description><![CDATA[Hello Friends, A layout contains presentation code that wraps around a view. Anything you want to see in all of your views should be placed in a layout.So your every view is wrapped by one layout,If you are not using including layout by $this-&#62;layout = &#8216;layout_name&#8217;; than every time it will use default layout, yesterday &#8230; <a href="http://php-freelancer.in/2010/05/08/cakephp-how-to-not-include-layout-in-a-view/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello Friends, A layout contains presentation code that wraps around a view. Anything you want to see in all of your views should be placed in a layout.So your every view is wrapped by one layout,If you are not using including layout by $this-&gt;layout = &#8216;layout_name&#8217;; than every time it will use default layout, yesterday when I was working on Ajax ,I got one problem in which I don&#8217;t want to use any layout in view but it was including default layout, So I have searched on internet about this and hardly find this solution, So I thought to share it on my site<span id="more-100"></span>.</p>
<p>If you want to use any other layout in view than you have to write in controller like this :</p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p><code>$this-&gt;layout = 'layout_name';</code></p>
<p>&#8216;layout_name&#8217; should be your layout name and which exists in &#8216;/app/views/layouts&#8217; directory, Now if you dont want to include any layout in view than you have to make false layout for that controller. Like this.</p>
<p><code>$this-&gt;layout = false;</code></p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2010/05/08/cakephp-how-to-not-include-layout-in-a-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP : Load Other Model In Controller</title>
		<link>http://php-freelancer.in/2010/05/08/cakephp-load-other-model-in-controller/</link>
		<comments>http://php-freelancer.in/2010/05/08/cakephp-load-other-model-in-controller/#comments</comments>
		<pubDate>Sat, 08 May 2010 09:47:40 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[load model in controller]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=98</guid>
		<description><![CDATA[Hello Friends, These days I am totally giving tricks and ideas relates to cakePHP and in this article I will also tell you how to load other model in other controller to use instantly. There are two ways to make available other model in controller, One is $uses variable in controller and other is loadModel &#8230; <a href="http://php-freelancer.in/2010/05/08/cakephp-load-other-model-in-controller/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello Friends, These days I am totally giving tricks and ideas relates to cakePHP and in this article I will also tell you how to load other model in other controller to use instantly. There are two ways to make available other model in controller, One is $uses variable in controller and other is loadModel function. $uses way is not efficient to make available or to include other model in controller So there is second way by which we can load other model in controller is loadModel function<span id="more-98"></span>.</p>
<p>I am always using loadModel function to load model in controller but I am giving overview of both ways.</p>
<p>First I am explaining $uses variable method. Whenever you want to include or make available other model in controller than you can use $uses variable at start of controller like this<br />
<code>&lt;?php<br />
class RecipesController extends AppController {<br />
var $name = 'Recipes';<br />
var $uses = array('Product', 'User');<br />
}<br />
?&gt; </code></p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>As you see in above code by $uses variable I have included or make available two models Product and User, So If you want to make available other model in controller you can use $uses variable and than write your model name in that array.</p>
<p>Second way loadModel function, It is efficient way to make available model or load model in controller. Syntax of loadModel function :<br />
<code>$this-&gt;loadModel('User');<br />
$users= $this-&gt;User-&gt;find('all');</code></p>
<p>In this way you can load model, Just pass model name in loadModel function and than you can use that model for Db interaction.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2010/05/08/cakephp-load-other-model-in-controller/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Optimize CakePHP Web Application By Element Caching</title>
		<link>http://php-freelancer.in/2010/05/04/optimize-cakephp-web-application-by-element-caching/</link>
		<comments>http://php-freelancer.in/2010/05/04/optimize-cakephp-web-application-by-element-caching/#comments</comments>
		<pubDate>Tue, 04 May 2010 17:46:23 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[CakePHP Element caching]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=91</guid>
		<description><![CDATA[Hello Friends, I have written some articles relates to element and its use for an application that how cakePHP elements can be useful for web application. Now today I am again want to writing about cakePHP element for web application optimization. As we know that Many applications have small blocks of presentation code that need &#8230; <a href="http://php-freelancer.in/2010/05/04/optimize-cakephp-web-application-by-element-caching/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://php-freelancer.in/wp-content/uploads/2010/05/img-67-96x96.png"><img class="alignright size-full wp-image-92" title="img-67-96x96" src="http://php-freelancer.in/wp-content/uploads/2010/05/img-67-96x96.png" alt="" width="96" height="96" /></a>Hello Friends, I have written some articles relates to element and its use for an application that how cakePHP elements can be useful for web application. Now today I am again want to writing about cakePHP element for web application optimization. As we know that Many applications have small blocks of presentation code that need to be  repeated from page to page, sometimes in different places in the  layout. CakePHP can help you repeat parts of your website that need to  be reused. These reusable parts are called Elements. So when we use reusable elements in any application and that element having any interaction with database to retrieve any thing then it is obvious that every time when that element load with page it interacts with DB to retrieve data, But as elements are reusable parts so we can cache that reusable parts . That means if we use element caching then it will not interact with database eveytime, It will interact first time and after that automatically take from cache, So this thing will not interact with your database eveytime and in this way you can optimized cakePHP application via element caching<span id="more-91"></span>.</p>
<p>You can take advantage of CakePHP view/element caching if you supply a cache parameter. If set to true, it will cache for 1 day. Otherwise, you can set alternative expiration times. See <a href="http://book.cakephp.org/view/156/caching" target="_blank">Caching</a> for more information on setting expiration.<br />
<code>&lt;?php echo $this-&gt;element('helpbox', array('cache' =&gt; true)); ?&gt;</code></p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Your default caching must be enabled for element caching to be worked.</p>
<p>If you render the same element more than once in a view and have caching enabled be sure to set the &#8216;key&#8217; parameter to a different name each time. This will prevent each succesive call from overwriting the previous element() call&#8217;s cached result. E.g.<br />
<code>&lt;?php<br />
echo $this-&gt;element('helpbox', array('cache' =&gt; array('key' =&gt; 'first_use', 'time' =&gt; '+1 day'), 'var' =&gt; $var));</code></p>
<p><code>echo $this-&gt;element('helpbox', array('cache' =&gt; array('key' =&gt; 'second_use', 'time' =&gt; '+1 day'), 'var' =&gt; $differentVar));<br />
?&gt;</code><br />
The above will ensure that both element results are cached separately.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">Optimize CakePHP Web Application By Element Caching</div>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2010/05/04/optimize-cakephp-web-application-by-element-caching/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CakePHP: How To Include Element In View In CakePHP</title>
		<link>http://php-freelancer.in/2010/05/04/cakephp-how-to-include-element-in-view-in-cakephp/</link>
		<comments>http://php-freelancer.in/2010/05/04/cakephp-how-to-include-element-in-view-in-cakephp/#comments</comments>
		<pubDate>Tue, 04 May 2010 09:39:43 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Use element in CakePHP]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=85</guid>
		<description><![CDATA[Hello Friends, As I am writing some important stuffs on CakePHP, But today i want to share one simple and basic thing with you about cakePHP element that how can we include cakePHP element in view. Basically Many applications have small blocks of presentation code that need to be repeated from page to page, sometimes &#8230; <a href="http://php-freelancer.in/2010/05/04/cakephp-how-to-include-element-in-view-in-cakephp/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello Friends, As I am writing some important stuffs on CakePHP, But today i want to share one simple and basic thing with you about cakePHP element that how can we include cakePHP element in view. Basically Many applications have small blocks of presentation code that need to be repeated from page to page, sometimes in different places in the layout. CakePHP can help you repeat parts of your website that need to be reused. These reusable parts are called Elements<span id="more-85"></span>.</p>
<p>So to make an element simple make a blank php file then write your element code in it and save that file in your app/views/element folder and save it as .ctp file, for this article we save it as top.ctp. Now in top.ctp you can write code you want to use/repeat in other/all pages. In top.ctp you can put html code for navigation menu or footer links or any other code which you want to use/repeat in pages.</p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Now below is the syntax by which you can include or call element:</p>
<p><code>&lt;?php echo $this-&gt;element('top', array("variable_name" =&gt; "current")); ?&gt;</code></p>
<p>Here you have to write only &#8216;top&#8217; as element name, not top.ctp and you can pass one variable to that element(top.ctp) file as shown above. In above example after top there is one array by which we can pass a variable to that element file.If you want to see in detail that how to use passed variables in element then <a href="http://php-freelancer.in/2010/04/28/cakephp-how-to-pass-variable-to-an-element-to-make-menu-selected/" target="_blank">check out here</a>.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2010/05/04/cakephp-how-to-include-element-in-view-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP : How To Make Image Submit Button</title>
		<link>http://php-freelancer.in/2010/04/28/cakephp-how-to-make-image-submit-button/</link>
		<comments>http://php-freelancer.in/2010/04/28/cakephp-how-to-make-image-submit-button/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 16:46:53 +0000</pubDate>
		<dc:creator>Ankur</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[CakePHp Image Submit Button]]></category>

		<guid isPermaLink="false">http://php-freelancer.in/?p=82</guid>
		<description><![CDATA[Hello Friends, CakePHP having form helper to make text box,forms ad any other HTML input, But today I want to make a image work as submit button because one of my submit button in project using image, So I want to submit form when anyone click on image button, I have tried to search on &#8230; <a href="http://php-freelancer.in/2010/04/28/cakephp-how-to-make-image-submit-button/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello Friends, CakePHP having form helper to make text box,forms ad any other HTML input, But today I want to make a image work as submit button because one of my submit button in project using image, So I want to submit form when anyone click on image button, I have tried to search on internet about it that how can we make a image submit button and didn&#8217;t get any proper solution, Finally I tried it myself and got solution for it. I don&#8217;t know it is correct solution but it is working perfectly for me<span id="more-82"></span>.</p>
<p><code>&lt;?php echo $form-&gt;submit('', array('type'=&gt;'image','src' =&gt; 'img/buttons/buynow.gif'));  ?&gt;</code></p>
<div id="in_post_ad_middle_1" style="text-align:center;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-8444019803708971";
/* Middleofpost */
google_ad_slot = "5399229243";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>In Above code just replace &#8216;img/buttons/buynow.gif&#8217; with your image path. It will show image and working as submit button.</p>
<p>Let me know if you have any problem in this.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://php-freelancer.in/2010/04/28/cakephp-how-to-make-image-submit-button/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

