<?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/">
	<channel>
		<title><![CDATA[انجمن پشتیبانی فارسی فریم ورک کیک پی اچ چی - cakephp - تمام انجمن‌ها]]></title>
		<link>http://forum.cakephp.ir/</link>
		<description><![CDATA[انجمن پشتیبانی فارسی فریم ورک کیک پی اچ چی - cakephp - http://forum.cakephp.ir]]></description>
		<pubDate>Mon, 06 Feb 2012 10:26:07 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Rss Helper]]></title>
			<link>http://forum.cakephp.ir/thread-553.html</link>
			<pubDate>Sun, 05 Feb 2012 07:56:30 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-553.html</guid>
			<description><![CDATA[سلام<br />
استفاده از این کمک کننده را پیشنهاد می کنید و یا نوشتن rss به صورت دستی ؟<br />
بنده کمی با این helper مشکل دارم دوستان اگر تجربه ای دارید راهنمایی بفرمائید ، <br />
 ( مثلا وقتی به آدرس index.rss می رویم مرورگر فید را نمی شناسد و می خواهد فایل را دانلود کند ! )<br />
ممنونم]]></description>
			<content:encoded><![CDATA[سلام<br />
استفاده از این کمک کننده را پیشنهاد می کنید و یا نوشتن rss به صورت دستی ؟<br />
بنده کمی با این helper مشکل دارم دوستان اگر تجربه ای دارید راهنمایی بفرمائید ، <br />
 ( مثلا وقتی به آدرس index.rss می رویم مرورگر فید را نمی شناسد و می خواهد فایل را دانلود کند ! )<br />
ممنونم]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[تفاوت set با compact]]></title>
			<link>http://forum.cakephp.ir/thread-552.html</link>
			<pubDate>Sun, 05 Feb 2012 07:49:09 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-552.html</guid>
			<description><![CDATA[سلام<br />
می خواستم بدونم تفاوت set با set(compact در چی هست ؟<br />
ممنون]]></description>
			<content:encoded><![CDATA[سلام<br />
می خواستم بدونم تفاوت set با set(compact در چی هست ؟<br />
ممنون]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[مقاله من در پی اچ پی مسترز internationalization and localization in CakePHP]]></title>
			<link>http://forum.cakephp.ir/thread-550.html</link>
			<pubDate>Sun, 05 Feb 2012 04:59:39 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-550.html</guid>
			<description><![CDATA[One of the best ways for your applications to reach a larger audience is to cater for multiple languages. This can often prove to be a daunting task, but the internationalization and localization features in CakePHP make it much easier and better one of the advantages of CakePHP is Internationalization and Localization with static translations in gettext style or dynamic translations of model data and It’s a good idea to serve up public content available in multiple languages from a unique url – this makes it easy for users (and search engines) to find what they’re looking for in the language they are expecting. There are several ways to do this, it can be by using language specific subdomains (en.example.com, fra.example.com, etc.), or using a prefix to the url such as is done with this application. You may also wish to glean the information from the browser’s user-agent, among other things.<br />
<br />
First, it’s important to understand some terminology. Internationalization refers to the ability of an application to be localized. The term localization refers to the adaptation of an application to meet specific language (or culture) requirements (i.e., a “locale”).<br />
<br />
1-Part:<br />
<br />
First of all you need to change the Security.salt value of the config/core.php to a different value, and then create the file /app/config/config.php for inserting the languages you want to display. In this article I’ll use English and Spanish, and the default language is English.<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/*&nbsp;add&nbsp;language&nbsp;to&nbsp;the&nbsp;file*/<br /><br /></span><span style="color: #0000BB">&#36;config</span><span style="color: #007700">[</span><span style="color: #DD0000">'LANGUAGE'</span><span style="color: #007700">]&nbsp;=&nbsp;array(</span><span style="color: #0000BB">‘supported’&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(</span><span style="color: #0000BB">‘eng’</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">‘spa’</span><span style="color: #007700">),<br /><br /></span><span style="color: #0000BB">‘default’&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">‘eng’</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div>
Internationalization and localization are often abbreviated as i18n and l10n respectively,<br />
<br />
Why CakePHP  use i18n or L10n?<br />
<br />
because The terms are frequently abbreviated to the numeronyms i18n (where 18 stands for the number of letters between the first i and last n in internationalization, a usage coined at DEC in the 1970s or 80s) and L10n respectively, due to the length of the words. The capital L in L10n helps to distinguish it from the lowercase i in i18n.<br />
<br />
You need to know your own language abbreviation. Here is the list of languages and the abbreviation of them:<br />
<br />
cake/libs/l10n.php<br />
<br />
Note:The three-character locale codes conform to the ISO 639-2 standard, although if you create regional locales (en_US, en_GB, etc.) cake will use them if appropriate.if you use The three-character locale code it will locale as a fallback if it doesn’t exist add it manually like this<br />
<br />
&#36;this-&gt;Session-&gt;write(‘Config.language’, ‘eng’);<br />
<br />
 <br />
<br />
For loading the configuration in your application, you need to append the following code at the end of file config/core.php<br />
<br />
PHP Code<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php<br /><br />Configure</span><span style="color: #007700">::</span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #0000BB">‘config’</span><span style="color: #007700">);</span><span style="color: #0000BB">?&gt;</span></code></div></div></div>
2-Part:<br />
<br />
The language files in CakePHP have either the extension .po or .mo. In this tutorial I’ll use .po files.<br />
<br />
For getting more information you can refer to this article:<br />
<br />
Localizing PHP Applications series Abouzekry wrote. <a href="http://phpmaster.com/localizing-php-applications-1" target="_blank">http://phpmaster.com/localizing-php-applications-1</a><br />
<br />
Note: Remember that po files are useful for short messages, if you find you want to translate long paragraphs, or even whole pages – you should consider implementing a different solution which we skip in this article<br />
<br />
We create this folders:<br />
<br />
app/locale/eng<br />
app/locale/spa<br />
For this tutorial, we will use translation for “messages”, so each language folder we have a sub folder names LC_MESSAGES (in uppercase).<br />
<br />
Now we should have this:<br />
<br />
app/locale/eng/LC_MESSAGES/default.po<br />
<br />
app/locale/spa/LC_MESSAGES/default.po<br />
<br />
Now that this step is finished, we can move on to the next step.<br />
<br />
3-Part:<br />
<br />
In order to work with CakePHP’s text function (ie : __() ..etc ..) first we need to describe them , in fact The __() function identifies these strings as translatable text that will differ by language locale and uses the text within the __() function as the message ID. If we define the translations for a certain language, those translations will appear in place of these functions. If we do not define the translations for that language, the text within the __() function will display instead by default. Every word or phrase to translate is composed of a pair id-string the id is the “msgid” value and the string is the “msgstr” value.<br />
<br />
Your Spanish PO file should look like this:<br />
<br />
CODE<br />
<br />
msgid “bienvenida”<br />
<br />
msgstr ” En varios idiomas-tutorial por Alireza.”<br />
<br />
msgid “congrat”<br />
<br />
msgstr ” le da las gracias”<br />
<br />
We now need to make a fake controller to switch between languages. It’s role consists of calling the AppController::beforeFilter() method when a user wants to switch languages.<br />
<br />
Create the controller in app/controllers/switchto_controller.php using the following code:<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">SwitchtoController&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">AppController&nbsp;</span><span style="color: #007700">{<br /><br />var&nbsp;</span><span style="color: #0000BB">&#36;uses&nbsp;</span><span style="color: #007700">=&nbsp;array();<br /><br />var&nbsp;</span><span style="color: #0000BB">&#36;name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">‘Switchto’</span><span style="color: #007700">;<br /><br />function&nbsp;</span><span style="color: #0000BB">beforeFilter</span><span style="color: #007700">()<br /><br />{<br /><br /></span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">beforeFilter</span><span style="color: #007700">();<br /><br />}<br /><br />}<br /><br />&nbsp;<br /><br /></span><span style="color: #0000BB">The&nbsp;AppController&nbsp;needs&nbsp;some&nbsp;modifications</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">edit&nbsp;the&nbsp;controller&nbsp;so&nbsp;it&nbsp;looks&nbsp;like&nbsp;this</span><span style="color: #007700">:<br /><br />&lt;?</span><span style="color: #0000BB">php<br /><br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">AppController&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Controller<br /><br /></span><span style="color: #007700">{<br /><br />function&nbsp;</span><span style="color: #0000BB">beforeFilter</span><span style="color: #007700">()<br /><br />{<br /><br />if(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_checkLanguage</span><span style="color: #007700">())<br /><br /></span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">redirect</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">referer</span><span style="color: #007700">(),&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /><br />}<br /><br />function&nbsp;</span><span style="color: #0000BB">_checkLanguage</span><span style="color: #007700">()<br /><br />{<br /><br />if(!</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">check</span><span style="color: #007700">(</span><span style="color: #0000BB">‘Config</span><span style="color: #007700">.</span><span style="color: #0000BB">language’</span><span style="color: #007700">)&nbsp;||&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">“Switchto”</span><span style="color: #007700">)&nbsp;{<br /><br /></span><span style="color: #0000BB">&#36;default_lang&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Configure</span><span style="color: #007700">::</span><span style="color: #0000BB">read</span><span style="color: #007700">(</span><span style="color: #0000BB">‘LANGUAGE</span><span style="color: #007700">.</span><span style="color: #0000BB">default’</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;supported_lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Configure</span><span style="color: #007700">::</span><span style="color: #0000BB">read</span><span style="color: #007700">(</span><span style="color: #0000BB">‘LANGUAGE</span><span style="color: #007700">.</span><span style="color: #0000BB">supported’</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /><br />if(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">“Switchto”</span><span style="color: #007700">)<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">action</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;we&nbsp;need&nbsp;the&nbsp;Cookie<br /><br /></span><span style="color: #0000BB">App</span><span style="color: #007700">::</span><span style="color: #0000BB">Import</span><span style="color: #007700">(</span><span style="color: #0000BB">‘Component’</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">‘Cookie’</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;cookie&nbsp;</span><span style="color: #007700">=&nbsp;&amp;&nbsp;new&nbsp;</span><span style="color: #0000BB">CookieComponent</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">time&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">‘</span><span style="color: #007700">+</span><span style="color: #0000BB">360&nbsp;days’</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">‘MYAPP’</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">domain&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">”</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">key&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">‘whatever</span><span style="color: #007700">-</span><span style="color: #0000BB">key</span><span style="color: #007700">-</span><span style="color: #0000BB">you</span><span style="color: #007700">-</span><span style="color: #0000BB">wish’</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">startup</span><span style="color: #007700">();<br /><br />if(!</span><span style="color: #0000BB">class_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">“L10n”</span><span style="color: #007700">))<br /><br /></span><span style="color: #0000BB">uses</span><span style="color: #007700">(</span><span style="color: #0000BB">‘l10n’</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;l10n&nbsp;</span><span style="color: #007700">=&nbsp;&amp;&nbsp;new&nbsp;</span><span style="color: #0000BB">L10n</span><span style="color: #007700">();<br /><br />if(!</span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">||&nbsp;!</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;supported_lang</span><span style="color: #007700">))<br /><br />{<br /><br />if(</span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">read</span><span style="color: #007700">(</span><span style="color: #0000BB">‘tutolanguage</span><span style="color: #007700">.</span><span style="color: #0000BB">lang’</span><span style="color: #007700">)&nbsp;)<br /><br />{<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">read</span><span style="color: #007700">(</span><span style="color: #0000BB">‘tutolang</span><span style="color: #007700">/</span><span style="color: #0000BB">lang’</span><span style="color: #007700">);<br /><br />if(!</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;supported_lang</span><span style="color: #007700">))<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /><br />}<br /><br /></span><span style="color: #FF8000">/*&nbsp;try&nbsp;to&nbsp;find&nbsp;a&nbsp;language&nbsp;spaom&nbsp;browser&nbsp;that&nbsp;we&nbsp;support&nbsp;*/<br /><br /></span><span style="color: #007700">if(!</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">)<br /><br />{<br /><br /></span><span style="color: #0000BB">&#36;browserLang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">split&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">‘</span><span style="color: #007700">[,;]</span><span style="color: #0000BB">‘</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">env</span><span style="color: #007700">(</span><span style="color: #0000BB">‘HTTP_ACCEPT_LANGUAGE’</span><span style="color: #007700">));<br /><br />foreach(</span><span style="color: #0000BB">&#36;browserLang&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">&#36;langKey&nbsp;</span><span style="color: #007700">)<br /><br />{<br /><br />if(isset(</span><span style="color: #0000BB">&#36;l10n</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">__l10nCatalog</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;langKey</span><span style="color: #007700">])&nbsp;&amp;&amp;<br /><br /></span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;l10n</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">__l10nCatalog</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;langKey</span><span style="color: #007700">][</span><span style="color: #DD0000">'locale'</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;supported_lang</span><span style="color: #007700">)&nbsp;)<br /><br />{<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;l10n</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">__l10nCatalog</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;langKey</span><span style="color: #007700">][</span><span style="color: #DD0000">'locale'</span><span style="color: #007700">];<br /><br />break;<br /><br />}<br /><br />}<br /><br />}<br /><br />}<br /><br />if(!</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">)<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;language_default</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;set&nbsp;the&nbsp;language,&nbsp;and&nbsp;write&nbsp;in&nbsp;cookie<br /><br /></span><span style="color: #0000BB">&#36;l10n</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">__setLanguage</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">write</span><span style="color: #007700">(array(</span><span style="color: #0000BB">‘tutolanguage</span><span style="color: #007700">.</span><span style="color: #0000BB">lang’&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">write</span><span style="color: #007700">(</span><span style="color: #0000BB">‘Config</span><span style="color: #007700">.</span><span style="color: #0000BB">language’</span><span style="color: #007700">,</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">);<br /><br />if(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">“Switchto”</span><span style="color: #007700">)<br /><br />return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br /><br />}<br /><br />return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /><br />}<br /><br />}&nbsp;<br /></span></code></div></div></div>
<br />
In order to remember the language selected by the user, we will use cookies and so I’ve imported the Cookie component. I’ve chosen to integrate the cookie this way instead of declaring it in &#36;components in order to avoid the overhead on the component in every call.<br />
<br />
Explanations for _checkLanguage method:<br />
<br />
The method work  in 2 cases only: “when no session language is set” and “when user wants to switch language”. This is handling by the first condition statement.<br />
We get our supported languages and the default one from the configuration.<br />
If the controller is “SwitchTo”, it’s because the user clicks on a link to change the language. Then the action will be our language chosen (see below how to set a link to handle language switching. We suppose the desired language is the action name.<br />
Next we import the Cookie component. Indeed in order to remember the language we use cookies,I have used this way to integrate the cookie instead of declaring it in the &#36;components in order to avoid the overhead on the component in every call(I test it ).<br />
We set the cookie parameters, you may  change this to your own setting. Note that the call to &#36;cookie-&gt;startup is essential to have the expiration date properly initialized.<br />
We will use the class L10n for setting our language. We instantiate an object of this class.<br />
We verify that our desired language is supported (either the desired is null, or set by the SwitchTo action.<br />
If the language is not supported we look if we have it in the cookie. If so we still verify we support it (that can happen in case or a removal of a language).<br />
In case we did not have any language, we verify if one of the browser supported language is matching one of our supported language. If so, we will use the first one matching.<br />
Still no language defined, then we will use our application default’s language.<br />
We use the L10n _setLanguage method to set our language application wide and we set our session language (missing this will screw up the process).<br />
We write the language in the cookie. When a user comes back, he will be automatically set to the last language he was.<br />
We return true in case of a deliberated language switch in order the beforeFilter to redirect to the referrer URL.<br />
The beforerFilter is self-explanatory, we redirect to the referrer in case the user did choose another language.<br />
<br />
4-Part:<br />
<br />
A sample main page<br />
<br />
To test the example, I modified the cake default main page (copy from cake distribution and place it in app/views/pages/display.ctp<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #007700">&lt;</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;&lt;?</span><span style="color: #0000BB">php&nbsp;__</span><span style="color: #007700">(</span><span style="color: #0000BB">”&nbsp;bienvenida”</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;/h2&gt;<br /><br />&lt;br&nbsp;/&gt;<br /><br />&lt;ul&gt;<br /><br />&lt;li&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;html</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">link</span><span style="color: #007700">(</span><span style="color: #0000BB">‘English’</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">‘</span><span style="color: #007700">/</span><span style="color: #0000BB">switchto</span><span style="color: #007700">/</span><span style="color: #0000BB">eng’</span><span style="color: #007700">);</span><span style="color: #0000BB">?&gt;</span>&lt;/li&gt;<br /><br />&lt;li&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;html</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">link</span><span style="color: #007700">(</span><span style="color: #0000BB">‘Spanish’</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">‘</span><span style="color: #007700">/</span><span style="color: #0000BB">switchto</span><span style="color: #007700">/</span><span style="color: #0000BB">spa’</span><span style="color: #007700">);</span><span style="color: #0000BB">?&gt;</span>&lt;/li&gt;<br /><br />&lt;/ul&gt;<br /><br />&lt;br&nbsp;/&gt;<br /><br />&lt;h3&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">__</span><span style="color: #007700">(</span><span style="color: #0000BB">“congrat”</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);</span><span style="color: #0000BB">?&gt;</span>&lt;h3&gt;&nbsp;<br /></code></div></div></div>
<br />
The file demonstrates two ways in which the __() function is used. In either case, the first argument is a value that matches a msgid in the default.po file.  if the msgid is not found in the PO file, then the value will be returned as is. By default, the translation message (or the unmatched msgid) will be outputted to the user. But __() also supports a second optional Boolean parameter which you can use if you want to capture the output instead of sending it, perhaps to pass to another function or anything else you may need to do to it.<br />
<br />
It’s worth noting the language files are cached into the tmp/cache/persistent/cake_core_default_xxx files (where xxx is the locale). When using cake with debug = 0, be sure to delete the cached language file in order to reflect the changes immediately.<br />
<br />
5-Part: Summery<br />
<br />
When it comes to internationalization and localization  your web  application, you may have a lot of options but CakePHP will be the best choice . in fact using cookie instead of subdomain and other ways or using translations in gettext style have lots of advantages which we will find in this article and CakePHP make it rapid and more flexible to create your application<br />
<br />
<br />
warning alright of this article is reserved by <a href="http://www.engineer-rahmani.ir" target="_blank">http://www.engineer-rahmani.ir</a>-]]></description>
			<content:encoded><![CDATA[One of the best ways for your applications to reach a larger audience is to cater for multiple languages. This can often prove to be a daunting task, but the internationalization and localization features in CakePHP make it much easier and better one of the advantages of CakePHP is Internationalization and Localization with static translations in gettext style or dynamic translations of model data and It’s a good idea to serve up public content available in multiple languages from a unique url – this makes it easy for users (and search engines) to find what they’re looking for in the language they are expecting. There are several ways to do this, it can be by using language specific subdomains (en.example.com, fra.example.com, etc.), or using a prefix to the url such as is done with this application. You may also wish to glean the information from the browser’s user-agent, among other things.<br />
<br />
First, it’s important to understand some terminology. Internationalization refers to the ability of an application to be localized. The term localization refers to the adaptation of an application to meet specific language (or culture) requirements (i.e., a “locale”).<br />
<br />
1-Part:<br />
<br />
First of all you need to change the Security.salt value of the config/core.php to a different value, and then create the file /app/config/config.php for inserting the languages you want to display. In this article I’ll use English and Spanish, and the default language is English.<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/*&nbsp;add&nbsp;language&nbsp;to&nbsp;the&nbsp;file*/<br /><br /></span><span style="color: #0000BB">&#36;config</span><span style="color: #007700">[</span><span style="color: #DD0000">'LANGUAGE'</span><span style="color: #007700">]&nbsp;=&nbsp;array(</span><span style="color: #0000BB">‘supported’&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(</span><span style="color: #0000BB">‘eng’</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">‘spa’</span><span style="color: #007700">),<br /><br /></span><span style="color: #0000BB">‘default’&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">‘eng’</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div>
Internationalization and localization are often abbreviated as i18n and l10n respectively,<br />
<br />
Why CakePHP  use i18n or L10n?<br />
<br />
because The terms are frequently abbreviated to the numeronyms i18n (where 18 stands for the number of letters between the first i and last n in internationalization, a usage coined at DEC in the 1970s or 80s) and L10n respectively, due to the length of the words. The capital L in L10n helps to distinguish it from the lowercase i in i18n.<br />
<br />
You need to know your own language abbreviation. Here is the list of languages and the abbreviation of them:<br />
<br />
cake/libs/l10n.php<br />
<br />
Note:The three-character locale codes conform to the ISO 639-2 standard, although if you create regional locales (en_US, en_GB, etc.) cake will use them if appropriate.if you use The three-character locale code it will locale as a fallback if it doesn’t exist add it manually like this<br />
<br />
&#36;this-&gt;Session-&gt;write(‘Config.language’, ‘eng’);<br />
<br />
 <br />
<br />
For loading the configuration in your application, you need to append the following code at the end of file config/core.php<br />
<br />
PHP Code<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php<br /><br />Configure</span><span style="color: #007700">::</span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #0000BB">‘config’</span><span style="color: #007700">);</span><span style="color: #0000BB">?&gt;</span></code></div></div></div>
2-Part:<br />
<br />
The language files in CakePHP have either the extension .po or .mo. In this tutorial I’ll use .po files.<br />
<br />
For getting more information you can refer to this article:<br />
<br />
Localizing PHP Applications series Abouzekry wrote. <a href="http://phpmaster.com/localizing-php-applications-1" target="_blank">http://phpmaster.com/localizing-php-applications-1</a><br />
<br />
Note: Remember that po files are useful for short messages, if you find you want to translate long paragraphs, or even whole pages – you should consider implementing a different solution which we skip in this article<br />
<br />
We create this folders:<br />
<br />
app/locale/eng<br />
app/locale/spa<br />
For this tutorial, we will use translation for “messages”, so each language folder we have a sub folder names LC_MESSAGES (in uppercase).<br />
<br />
Now we should have this:<br />
<br />
app/locale/eng/LC_MESSAGES/default.po<br />
<br />
app/locale/spa/LC_MESSAGES/default.po<br />
<br />
Now that this step is finished, we can move on to the next step.<br />
<br />
3-Part:<br />
<br />
In order to work with CakePHP’s text function (ie : __() ..etc ..) first we need to describe them , in fact The __() function identifies these strings as translatable text that will differ by language locale and uses the text within the __() function as the message ID. If we define the translations for a certain language, those translations will appear in place of these functions. If we do not define the translations for that language, the text within the __() function will display instead by default. Every word or phrase to translate is composed of a pair id-string the id is the “msgid” value and the string is the “msgstr” value.<br />
<br />
Your Spanish PO file should look like this:<br />
<br />
CODE<br />
<br />
msgid “bienvenida”<br />
<br />
msgstr ” En varios idiomas-tutorial por Alireza.”<br />
<br />
msgid “congrat”<br />
<br />
msgstr ” le da las gracias”<br />
<br />
We now need to make a fake controller to switch between languages. It’s role consists of calling the AppController::beforeFilter() method when a user wants to switch languages.<br />
<br />
Create the controller in app/controllers/switchto_controller.php using the following code:<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">SwitchtoController&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">AppController&nbsp;</span><span style="color: #007700">{<br /><br />var&nbsp;</span><span style="color: #0000BB">&#36;uses&nbsp;</span><span style="color: #007700">=&nbsp;array();<br /><br />var&nbsp;</span><span style="color: #0000BB">&#36;name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">‘Switchto’</span><span style="color: #007700">;<br /><br />function&nbsp;</span><span style="color: #0000BB">beforeFilter</span><span style="color: #007700">()<br /><br />{<br /><br /></span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">beforeFilter</span><span style="color: #007700">();<br /><br />}<br /><br />}<br /><br />&nbsp;<br /><br /></span><span style="color: #0000BB">The&nbsp;AppController&nbsp;needs&nbsp;some&nbsp;modifications</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">edit&nbsp;the&nbsp;controller&nbsp;so&nbsp;it&nbsp;looks&nbsp;like&nbsp;this</span><span style="color: #007700">:<br /><br />&lt;?</span><span style="color: #0000BB">php<br /><br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">AppController&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Controller<br /><br /></span><span style="color: #007700">{<br /><br />function&nbsp;</span><span style="color: #0000BB">beforeFilter</span><span style="color: #007700">()<br /><br />{<br /><br />if(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_checkLanguage</span><span style="color: #007700">())<br /><br /></span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">redirect</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">referer</span><span style="color: #007700">(),&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /><br />}<br /><br />function&nbsp;</span><span style="color: #0000BB">_checkLanguage</span><span style="color: #007700">()<br /><br />{<br /><br />if(!</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">check</span><span style="color: #007700">(</span><span style="color: #0000BB">‘Config</span><span style="color: #007700">.</span><span style="color: #0000BB">language’</span><span style="color: #007700">)&nbsp;||&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">“Switchto”</span><span style="color: #007700">)&nbsp;{<br /><br /></span><span style="color: #0000BB">&#36;default_lang&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Configure</span><span style="color: #007700">::</span><span style="color: #0000BB">read</span><span style="color: #007700">(</span><span style="color: #0000BB">‘LANGUAGE</span><span style="color: #007700">.</span><span style="color: #0000BB">default’</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;supported_lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Configure</span><span style="color: #007700">::</span><span style="color: #0000BB">read</span><span style="color: #007700">(</span><span style="color: #0000BB">‘LANGUAGE</span><span style="color: #007700">.</span><span style="color: #0000BB">supported’</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /><br />if(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">“Switchto”</span><span style="color: #007700">)<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">action</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;we&nbsp;need&nbsp;the&nbsp;Cookie<br /><br /></span><span style="color: #0000BB">App</span><span style="color: #007700">::</span><span style="color: #0000BB">Import</span><span style="color: #007700">(</span><span style="color: #0000BB">‘Component’</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">‘Cookie’</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;cookie&nbsp;</span><span style="color: #007700">=&nbsp;&amp;&nbsp;new&nbsp;</span><span style="color: #0000BB">CookieComponent</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">time&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">‘</span><span style="color: #007700">+</span><span style="color: #0000BB">360&nbsp;days’</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">‘MYAPP’</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">domain&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">”</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">key&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">‘whatever</span><span style="color: #007700">-</span><span style="color: #0000BB">key</span><span style="color: #007700">-</span><span style="color: #0000BB">you</span><span style="color: #007700">-</span><span style="color: #0000BB">wish’</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">startup</span><span style="color: #007700">();<br /><br />if(!</span><span style="color: #0000BB">class_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">“L10n”</span><span style="color: #007700">))<br /><br /></span><span style="color: #0000BB">uses</span><span style="color: #007700">(</span><span style="color: #0000BB">‘l10n’</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;l10n&nbsp;</span><span style="color: #007700">=&nbsp;&amp;&nbsp;new&nbsp;</span><span style="color: #0000BB">L10n</span><span style="color: #007700">();<br /><br />if(!</span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">||&nbsp;!</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;supported_lang</span><span style="color: #007700">))<br /><br />{<br /><br />if(</span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">read</span><span style="color: #007700">(</span><span style="color: #0000BB">‘tutolanguage</span><span style="color: #007700">.</span><span style="color: #0000BB">lang’</span><span style="color: #007700">)&nbsp;)<br /><br />{<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">read</span><span style="color: #007700">(</span><span style="color: #0000BB">‘tutolang</span><span style="color: #007700">/</span><span style="color: #0000BB">lang’</span><span style="color: #007700">);<br /><br />if(!</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;supported_lang</span><span style="color: #007700">))<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /><br />}<br /><br /></span><span style="color: #FF8000">/*&nbsp;try&nbsp;to&nbsp;find&nbsp;a&nbsp;language&nbsp;spaom&nbsp;browser&nbsp;that&nbsp;we&nbsp;support&nbsp;*/<br /><br /></span><span style="color: #007700">if(!</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">)<br /><br />{<br /><br /></span><span style="color: #0000BB">&#36;browserLang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">split&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">‘</span><span style="color: #007700">[,;]</span><span style="color: #0000BB">‘</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">env</span><span style="color: #007700">(</span><span style="color: #0000BB">‘HTTP_ACCEPT_LANGUAGE’</span><span style="color: #007700">));<br /><br />foreach(</span><span style="color: #0000BB">&#36;browserLang&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">&#36;langKey&nbsp;</span><span style="color: #007700">)<br /><br />{<br /><br />if(isset(</span><span style="color: #0000BB">&#36;l10n</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">__l10nCatalog</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;langKey</span><span style="color: #007700">])&nbsp;&amp;&amp;<br /><br /></span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;l10n</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">__l10nCatalog</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;langKey</span><span style="color: #007700">][</span><span style="color: #DD0000">'locale'</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;supported_lang</span><span style="color: #007700">)&nbsp;)<br /><br />{<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;l10n</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">__l10nCatalog</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;langKey</span><span style="color: #007700">][</span><span style="color: #DD0000">'locale'</span><span style="color: #007700">];<br /><br />break;<br /><br />}<br /><br />}<br /><br />}<br /><br />}<br /><br />if(!</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">)<br /><br /></span><span style="color: #0000BB">&#36;lang&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;language_default</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;set&nbsp;the&nbsp;language,&nbsp;and&nbsp;write&nbsp;in&nbsp;cookie<br /><br /></span><span style="color: #0000BB">&#36;l10n</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">__setLanguage</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">&#36;cookie</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">write</span><span style="color: #007700">(array(</span><span style="color: #0000BB">‘tutolanguage</span><span style="color: #007700">.</span><span style="color: #0000BB">lang’&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">write</span><span style="color: #007700">(</span><span style="color: #0000BB">‘Config</span><span style="color: #007700">.</span><span style="color: #0000BB">language’</span><span style="color: #007700">,</span><span style="color: #0000BB">&#36;lang</span><span style="color: #007700">);<br /><br />if(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">“Switchto”</span><span style="color: #007700">)<br /><br />return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br /><br />}<br /><br />return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /><br />}<br /><br />}&nbsp;<br /></span></code></div></div></div>
<br />
In order to remember the language selected by the user, we will use cookies and so I’ve imported the Cookie component. I’ve chosen to integrate the cookie this way instead of declaring it in &#36;components in order to avoid the overhead on the component in every call.<br />
<br />
Explanations for _checkLanguage method:<br />
<br />
The method work  in 2 cases only: “when no session language is set” and “when user wants to switch language”. This is handling by the first condition statement.<br />
We get our supported languages and the default one from the configuration.<br />
If the controller is “SwitchTo”, it’s because the user clicks on a link to change the language. Then the action will be our language chosen (see below how to set a link to handle language switching. We suppose the desired language is the action name.<br />
Next we import the Cookie component. Indeed in order to remember the language we use cookies,I have used this way to integrate the cookie instead of declaring it in the &#36;components in order to avoid the overhead on the component in every call(I test it ).<br />
We set the cookie parameters, you may  change this to your own setting. Note that the call to &#36;cookie-&gt;startup is essential to have the expiration date properly initialized.<br />
We will use the class L10n for setting our language. We instantiate an object of this class.<br />
We verify that our desired language is supported (either the desired is null, or set by the SwitchTo action.<br />
If the language is not supported we look if we have it in the cookie. If so we still verify we support it (that can happen in case or a removal of a language).<br />
In case we did not have any language, we verify if one of the browser supported language is matching one of our supported language. If so, we will use the first one matching.<br />
Still no language defined, then we will use our application default’s language.<br />
We use the L10n _setLanguage method to set our language application wide and we set our session language (missing this will screw up the process).<br />
We write the language in the cookie. When a user comes back, he will be automatically set to the last language he was.<br />
We return true in case of a deliberated language switch in order the beforeFilter to redirect to the referrer URL.<br />
The beforerFilter is self-explanatory, we redirect to the referrer in case the user did choose another language.<br />
<br />
4-Part:<br />
<br />
A sample main page<br />
<br />
To test the example, I modified the cake default main page (copy from cake distribution and place it in app/views/pages/display.ctp<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #007700">&lt;</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;&lt;?</span><span style="color: #0000BB">php&nbsp;__</span><span style="color: #007700">(</span><span style="color: #0000BB">”&nbsp;bienvenida”</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;/h2&gt;<br /><br />&lt;br&nbsp;/&gt;<br /><br />&lt;ul&gt;<br /><br />&lt;li&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;html</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">link</span><span style="color: #007700">(</span><span style="color: #0000BB">‘English’</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">‘</span><span style="color: #007700">/</span><span style="color: #0000BB">switchto</span><span style="color: #007700">/</span><span style="color: #0000BB">eng’</span><span style="color: #007700">);</span><span style="color: #0000BB">?&gt;</span>&lt;/li&gt;<br /><br />&lt;li&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;html</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">link</span><span style="color: #007700">(</span><span style="color: #0000BB">‘Spanish’</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">‘</span><span style="color: #007700">/</span><span style="color: #0000BB">switchto</span><span style="color: #007700">/</span><span style="color: #0000BB">spa’</span><span style="color: #007700">);</span><span style="color: #0000BB">?&gt;</span>&lt;/li&gt;<br /><br />&lt;/ul&gt;<br /><br />&lt;br&nbsp;/&gt;<br /><br />&lt;h3&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">__</span><span style="color: #007700">(</span><span style="color: #0000BB">“congrat”</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);</span><span style="color: #0000BB">?&gt;</span>&lt;h3&gt;&nbsp;<br /></code></div></div></div>
<br />
The file demonstrates two ways in which the __() function is used. In either case, the first argument is a value that matches a msgid in the default.po file.  if the msgid is not found in the PO file, then the value will be returned as is. By default, the translation message (or the unmatched msgid) will be outputted to the user. But __() also supports a second optional Boolean parameter which you can use if you want to capture the output instead of sending it, perhaps to pass to another function or anything else you may need to do to it.<br />
<br />
It’s worth noting the language files are cached into the tmp/cache/persistent/cake_core_default_xxx files (where xxx is the locale). When using cake with debug = 0, be sure to delete the cached language file in order to reflect the changes immediately.<br />
<br />
5-Part: Summery<br />
<br />
When it comes to internationalization and localization  your web  application, you may have a lot of options but CakePHP will be the best choice . in fact using cookie instead of subdomain and other ways or using translations in gettext style have lots of advantages which we will find in this article and CakePHP make it rapid and more flexible to create your application<br />
<br />
<br />
warning alright of this article is reserved by <a href="http://www.engineer-rahmani.ir" target="_blank">http://www.engineer-rahmani.ir</a>-]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[استفاده از متغیر در کوئری]]></title>
			<link>http://forum.cakephp.ir/thread-549.html</link>
			<pubDate>Fri, 03 Feb 2012 20:16:38 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-549.html</guid>
			<description><![CDATA[با سلام<br />
من می خواستم توی یک custom query از یک متغیر برای ایجاد شرط استفاده کنم اما از هر دری رفتم کیک رو سیاهم کرد ممکنه راهنمایی بفرمائید.<br />
برای مثال من می خوام همیچین کوئری بنویسم<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #DD0000">'SELECT&nbsp;*&nbsp;FROM&nbsp;`comments`&nbsp;where&nbsp;Id&nbsp;=&nbsp;`&#36;pId`&nbsp;'&nbsp;<br /></span></code></div></div></div>
اما کیک متغیر من رو اصلاً به عنوان یک متغیر نمی شناسه و به عنوان یک ستون جدول بهش نگاه می کنه.<br />
از تمام راه هایش معمولی که توی پی اچ هست استفاده کردم اما نشد که نشد. اگر کسی از دوستان در این مورد اطلاع داره خواهش می کنم به من هم بگه.<br />
<br />
ممنون]]></description>
			<content:encoded><![CDATA[با سلام<br />
من می خواستم توی یک custom query از یک متغیر برای ایجاد شرط استفاده کنم اما از هر دری رفتم کیک رو سیاهم کرد ممکنه راهنمایی بفرمائید.<br />
برای مثال من می خوام همیچین کوئری بنویسم<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #DD0000">'SELECT&nbsp;*&nbsp;FROM&nbsp;`comments`&nbsp;where&nbsp;Id&nbsp;=&nbsp;`&#36;pId`&nbsp;'&nbsp;<br /></span></code></div></div></div>
اما کیک متغیر من رو اصلاً به عنوان یک متغیر نمی شناسه و به عنوان یک ستون جدول بهش نگاه می کنه.<br />
از تمام راه هایش معمولی که توی پی اچ هست استفاده کردم اما نشد که نشد. اگر کسی از دوستان در این مورد اطلاع داره خواهش می کنم به من هم بگه.<br />
<br />
ممنون]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[به یک  , css ,و  cake php کار نیازمندیم]]></title>
			<link>http://forum.cakephp.ir/thread-548.html</link>
			<pubDate>Fri, 03 Feb 2012 16:00:57 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-548.html</guid>
			<description><![CDATA[برای  توسعه یک نرم افزار تولید شده با کیک به به یک  , css ,و  cake php کار نیازمندیم + پاره وقت + تهران<br />
دوستان رزومه و نمونه کار های خود را میل کنید<br />
با تشکر<br />
<br />
halataei@idea.ir]]></description>
			<content:encoded><![CDATA[برای  توسعه یک نرم افزار تولید شده با کیک به به یک  , css ,و  cake php کار نیازمندیم + پاره وقت + تهران<br />
دوستان رزومه و نمونه کار های خود را میل کنید<br />
با تشکر<br />
<br />
halataei@idea.ir]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[layout برای انتخاب منوی سایت]]></title>
			<link>http://forum.cakephp.ir/thread-545.html</link>
			<pubDate>Thu, 02 Feb 2012 03:19:46 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-545.html</guid>
			<description><![CDATA[سلام<br />
توی همین سایت جون جونی کیک اگه دیده باشید . بالای صفحه یه منو داره.<br />
که روی هر کدوم که کلیک می کنید صفحه مورد نظر باز میشه و اون گزینه مورد نظر به حالت انتخاب در میاد.<br />
حالا سوال من اینجاست که برای اینکه توی سایتمون در هر صفحه منو مورد نظر به حال انتخاب دربیاد باید برای هر صفحه یه layout جداگونه نوشت که توی هر کدوم اون منو رو در حالت انتخاب بزاریم یا اینکه باز کیک راه حلی بهتری داری؟]]></description>
			<content:encoded><![CDATA[سلام<br />
توی همین سایت جون جونی کیک اگه دیده باشید . بالای صفحه یه منو داره.<br />
که روی هر کدوم که کلیک می کنید صفحه مورد نظر باز میشه و اون گزینه مورد نظر به حالت انتخاب در میاد.<br />
حالا سوال من اینجاست که برای اینکه توی سایتمون در هر صفحه منو مورد نظر به حال انتخاب دربیاد باید برای هر صفحه یه layout جداگونه نوشت که توی هر کدوم اون منو رو در حالت انتخاب بزاریم یا اینکه باز کیک راه حلی بهتری داری؟]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[مقدار فعلب فیلد در edit]]></title>
			<link>http://forum.cakephp.ir/thread-544.html</link>
			<pubDate>Wed, 01 Feb 2012 00:28:16 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-544.html</guid>
			<description><![CDATA[سلام<br />
توی تغییر رمز عبور user می خوام مقدار فعلی رمز عبور رو چک کنم.<br />
بزارید این طوری توضیح بدم:<br />
وقتی کاربر می خواد رمزعبور رو عوض کند. توی یه فیلد رمز عبور فعلی سوال میشه و در یه فیلد دیگه هم رمز عبور جدید!<br />
حالا سوال من اینجاست که جه طوری رمز عبور فعلی رو با این مقداری که کاربر وارد کرده چک کنم؟]]></description>
			<content:encoded><![CDATA[سلام<br />
توی تغییر رمز عبور user می خوام مقدار فعلی رمز عبور رو چک کنم.<br />
بزارید این طوری توضیح بدم:<br />
وقتی کاربر می خواد رمزعبور رو عوض کند. توی یه فیلد رمز عبور فعلی سوال میشه و در یه فیلد دیگه هم رمز عبور جدید!<br />
حالا سوال من اینجاست که جه طوری رمز عبور فعلی رو با این مقداری که کاربر وارد کرده چک کنم؟]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[پیاده سازی چند عملیات در یک صفحه]]></title>
			<link>http://forum.cakephp.ir/thread-543.html</link>
			<pubDate>Mon, 30 Jan 2012 12:02:47 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-543.html</guid>
			<description><![CDATA[باسلام خدمت دوستان گرامی<br />
باتوجه به مثال هایی که بنده در manual کیک ومطالب این فروم خوندم اکثرمطالب راجع به ارسال یک فرم دریک view همنام با action موردنظراون در controller هستش.<br />
اینجا برای من یه سوال پیش میاد :<br />
اگر دریک صفحه نیاز به دو یاچندعملیات یا فرم پیداکنیم ، آیاباید تمام کدهای ما درون action مستقیمش در controller باشه ؟<br />
یعنی باید با isset چک کنیم کدام عملیات انجام شده؟<br />
یا راه حل دیگه ای هست که بشه مستقیما action یا function دیگه ای روصدا زد؟<br />
بعنوان مثال سه تا عملیات توی یه صفحه داریم :<br />
1 - جستجو<br />
2 - ارسال فرم ثبت نام<br />
3 - ارسال نام کاربری و کلمه عبور<br />
<br />
حالا تمام کد مربوط به هرسه عملیات باید توی یک action  در controller نوشته بشه؟<br />
یا میشه از هم جداشون کرد؟<br />
ممنون میشم دوستان خوب]]></description>
			<content:encoded><![CDATA[باسلام خدمت دوستان گرامی<br />
باتوجه به مثال هایی که بنده در manual کیک ومطالب این فروم خوندم اکثرمطالب راجع به ارسال یک فرم دریک view همنام با action موردنظراون در controller هستش.<br />
اینجا برای من یه سوال پیش میاد :<br />
اگر دریک صفحه نیاز به دو یاچندعملیات یا فرم پیداکنیم ، آیاباید تمام کدهای ما درون action مستقیمش در controller باشه ؟<br />
یعنی باید با isset چک کنیم کدام عملیات انجام شده؟<br />
یا راه حل دیگه ای هست که بشه مستقیما action یا function دیگه ای روصدا زد؟<br />
بعنوان مثال سه تا عملیات توی یه صفحه داریم :<br />
1 - جستجو<br />
2 - ارسال فرم ثبت نام<br />
3 - ارسال نام کاربری و کلمه عبور<br />
<br />
حالا تمام کد مربوط به هرسه عملیات باید توی یک action  در controller نوشته بشه؟<br />
یا میشه از هم جداشون کرد؟<br />
ممنون میشم دوستان خوب]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[برنامه نویس کیک]]></title>
			<link>http://forum.cakephp.ir/thread-542.html</link>
			<pubDate>Sun, 29 Jan 2012 04:58:20 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-542.html</guid>
			<description><![CDATA[با سلام<br />
برای توسعه یک نرم افزار تولید شده با کیک به یک برنامه نویس کیک آشنا با اسمارتی نیازداریم<br />
برای مذاکره و کسب اطلاعات بیشتر ایمیل بزنید.<br />
 boshaq@gmail.com]]></description>
			<content:encoded><![CDATA[با سلام<br />
برای توسعه یک نرم افزار تولید شده با کیک به یک برنامه نویس کیک آشنا با اسمارتی نیازداریم<br />
برای مذاکره و کسب اطلاعات بیشتر ایمیل بزنید.<br />
 boshaq@gmail.com]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[مشکل عجیب و بزرگ امنیتی با گوگل]]></title>
			<link>http://forum.cakephp.ir/thread-541.html</link>
			<pubDate>Thu, 26 Jan 2012 09:26:52 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-541.html</guid>
			<description><![CDATA[سلام<br />
متاسفانه یک مشکل خیلی عجیب و غریبی پیش اومده و اون اینه که <br />
سایتی که با کیک نوشته شده روی هاست قرار گرفت و پس از چند روز یکی از ایندکس های گوگل از سایت موقع جستجو این هست :<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">viewFn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"/home/site/public_html/app/views/posts/cat.ctp"&nbsp;</span><span style="color: #0000BB">&#36;___dataForView&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"title_for_layout"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"اخبار"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"cats"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(&nbsp;array()&nbsp;),&nbsp;</span><span style="color: #DD0000">"catname"&nbsp;<br /></span></code></div></div></div>
<br />
و این یک مشکل بزرگ و یک ایراد امنیتی اساسی هست ، <span style="font-weight: bold;">مشکل از کیک هست یا من جایی اشتباه کردم ؟</span>  <img src="images/smilies/angry.gif" style="vertical-align: middle;" border="0" alt="Angry" title="Angry" />]]></description>
			<content:encoded><![CDATA[سلام<br />
متاسفانه یک مشکل خیلی عجیب و غریبی پیش اومده و اون اینه که <br />
سایتی که با کیک نوشته شده روی هاست قرار گرفت و پس از چند روز یکی از ایندکس های گوگل از سایت موقع جستجو این هست :<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">viewFn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"/home/site/public_html/app/views/posts/cat.ctp"&nbsp;</span><span style="color: #0000BB">&#36;___dataForView&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"title_for_layout"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"اخبار"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"cats"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(&nbsp;array()&nbsp;),&nbsp;</span><span style="color: #DD0000">"catname"&nbsp;<br /></span></code></div></div></div>
<br />
و این یک مشکل بزرگ و یک ایراد امنیتی اساسی هست ، <span style="font-weight: bold;">مشکل از کیک هست یا من جایی اشتباه کردم ؟</span>  <img src="images/smilies/angry.gif" style="vertical-align: middle;" border="0" alt="Angry" title="Angry" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[پیغام خطا در login]]></title>
			<link>http://forum.cakephp.ir/thread-540.html</link>
			<pubDate>Sat, 21 Jan 2012 07:55:03 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-540.html</guid>
			<description><![CDATA[سلام <br />
برای قسمت لاگین از مثال خود سایت استفاده کردم.<br />
اما مشکل اینجاست که زمانیکه صفحه لاگین باز میشه. قبل از اینکه کاربر رمز عبور رو اشتباه وارد کنه پیغام Invalid username or password, try again رو نمایش میده. <br />
یعنی هنوز کاربر هیچ اطلاعاتی رو وارد نکرده اما این پیغام نمایش داده میشه.<br />
<br />
اکشن لاگین : <br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">login</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Auth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">login</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">redirect</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Auth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">redirect</span><span style="color: #007700">());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setFlash</span><span style="color: #007700">(</span><span style="color: #0000BB">__</span><span style="color: #007700">(</span><span style="color: #DD0000">'Invalid&nbsp;username&nbsp;or&nbsp;password,&nbsp;try&nbsp;again'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br /></span></code></div></div></div>
<br />
view :<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php&nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">layout</span><span style="color: #007700">=</span><span style="color: #DD0000">'home'</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span>&lt;div&nbsp;id="content"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">flash</span><span style="color: #007700">(</span><span style="color: #DD0000">'auth'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;<br />&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">create</span><span style="color: #007700">(</span><span style="color: #DD0000">'User'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'id'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form'</span><span style="color: #007700">));</span><span style="color: #0000BB">?&gt;<br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">input</span><span style="color: #007700">(</span><span style="color: #DD0000">'username'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'div'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form-item-field'</span><span style="color: #007700">),</span><span style="color: #DD0000">'label'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'text'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'نام&nbsp;کاربری'</span><span style="color: #007700">,</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form-item-label'</span><span style="color: #007700">)));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">input</span><span style="color: #007700">(</span><span style="color: #DD0000">'password'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'div'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form-item-field'</span><span style="color: #007700">),</span><span style="color: #DD0000">'label'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'text'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'رمز&nbsp;عبور'</span><span style="color: #007700">,</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form-item-label'</span><span style="color: #007700">)));<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">submit</span><span style="color: #007700">(</span><span style="color: #DD0000">'ورود'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'div'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'commandBar'</span><span style="color: #007700">)));&nbsp;</span><span style="color: #0000BB">?&gt;<br />&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">end</span><span style="color: #007700">();</span><span style="color: #0000BB">?&gt;<br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<br />&lt;/div&gt;&nbsp;<br /></code></div></div></div>
]]></description>
			<content:encoded><![CDATA[سلام <br />
برای قسمت لاگین از مثال خود سایت استفاده کردم.<br />
اما مشکل اینجاست که زمانیکه صفحه لاگین باز میشه. قبل از اینکه کاربر رمز عبور رو اشتباه وارد کنه پیغام Invalid username or password, try again رو نمایش میده. <br />
یعنی هنوز کاربر هیچ اطلاعاتی رو وارد نکرده اما این پیغام نمایش داده میشه.<br />
<br />
اکشن لاگین : <br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">login</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Auth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">login</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">redirect</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Auth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">redirect</span><span style="color: #007700">());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setFlash</span><span style="color: #007700">(</span><span style="color: #0000BB">__</span><span style="color: #007700">(</span><span style="color: #DD0000">'Invalid&nbsp;username&nbsp;or&nbsp;password,&nbsp;try&nbsp;again'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br /></span></code></div></div></div>
<br />
view :<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php&nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">layout</span><span style="color: #007700">=</span><span style="color: #DD0000">'home'</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span>&lt;div&nbsp;id="content"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">flash</span><span style="color: #007700">(</span><span style="color: #DD0000">'auth'</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">?&gt;<br />&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">create</span><span style="color: #007700">(</span><span style="color: #DD0000">'User'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'id'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form'</span><span style="color: #007700">));</span><span style="color: #0000BB">?&gt;<br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">input</span><span style="color: #007700">(</span><span style="color: #DD0000">'username'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'div'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form-item-field'</span><span style="color: #007700">),</span><span style="color: #DD0000">'label'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'text'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'نام&nbsp;کاربری'</span><span style="color: #007700">,</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form-item-label'</span><span style="color: #007700">)));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">input</span><span style="color: #007700">(</span><span style="color: #DD0000">'password'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'div'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form-item-field'</span><span style="color: #007700">),</span><span style="color: #DD0000">'label'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'text'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'رمز&nbsp;عبور'</span><span style="color: #007700">,</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'form-item-label'</span><span style="color: #007700">)));<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">submit</span><span style="color: #007700">(</span><span style="color: #DD0000">'ورود'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'div'</span><span style="color: #007700">=&gt;array(</span><span style="color: #DD0000">'class'</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">'commandBar'</span><span style="color: #007700">)));&nbsp;</span><span style="color: #0000BB">?&gt;<br />&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Form</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">end</span><span style="color: #007700">();</span><span style="color: #0000BB">?&gt;<br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<br />&lt;/div&gt;&nbsp;<br /></code></div></div></div>
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[درخواست فیلم فارسی آموزش کیک پی اچ پی 2]]></title>
			<link>http://forum.cakephp.ir/thread-539.html</link>
			<pubDate>Thu, 19 Jan 2012 05:16:51 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-539.html</guid>
			<description><![CDATA[با سلام خدمت دوستان<br />
من یه فیلم فارسی میخواستم که کیک پی اچ پی رو یاد بگیرم<br />
اگر پولی هم بود مشکلی نداره<br />
فقط میخوام از 0 شروع کنه و روش کار کردن باهاشو توضیح بده و کد نویسی رو یاد بده<br />
و مثل این فیلم های خارجی طرف همزمان که توضیح میده خودشم کد بنویسه نه اینکه یکی از روی اسلاید بشینه روخونی کنه و به اسم فیلم آموزشی بده بیرون<br />
چون قبلا نمونش رو دیدم میگم<br />
ممنون میشم دوستان اگر چیزی دارن قرار بدن<br />
بازم تاکید میکنم حتما فارسی باشه<br />
با تشکر]]></description>
			<content:encoded><![CDATA[با سلام خدمت دوستان<br />
من یه فیلم فارسی میخواستم که کیک پی اچ پی رو یاد بگیرم<br />
اگر پولی هم بود مشکلی نداره<br />
فقط میخوام از 0 شروع کنه و روش کار کردن باهاشو توضیح بده و کد نویسی رو یاد بده<br />
و مثل این فیلم های خارجی طرف همزمان که توضیح میده خودشم کد بنویسه نه اینکه یکی از روی اسلاید بشینه روخونی کنه و به اسم فیلم آموزشی بده بیرون<br />
چون قبلا نمونش رو دیدم میگم<br />
ممنون میشم دوستان اگر چیزی دارن قرار بدن<br />
بازم تاکید میکنم حتما فارسی باشه<br />
با تشکر]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[آدرس ثابت جهت دریافت کیک]]></title>
			<link>http://forum.cakephp.ir/thread-538.html</link>
			<pubDate>Tue, 17 Jan 2012 13:52:37 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-538.html</guid>
			<description><![CDATA[سلام<br />
<br />
متاسفانه همونطور که اطلاع دارید دانلود کردن از گیت هاب جدیدا خیلی سخت تر از گذشته شده . اگر امکانش هست یک آدرس ثابت برای دریافت آخرین نسخه کیک قرار بدید مثل :<br />
<div class="codeblock">
<div class="title">کد:<br />
</div><div class="body" dir="ltr"><code>http://www.cakephp.ir/latest</code></div></div>
و به روز بشه تا همه راحت بتونن این فریم ورک رو دانلود کنن .]]></description>
			<content:encoded><![CDATA[سلام<br />
<br />
متاسفانه همونطور که اطلاع دارید دانلود کردن از گیت هاب جدیدا خیلی سخت تر از گذشته شده . اگر امکانش هست یک آدرس ثابت برای دریافت آخرین نسخه کیک قرار بدید مثل :<br />
<div class="codeblock">
<div class="title">کد:<br />
</div><div class="body" dir="ltr"><code>http://www.cakephp.ir/latest</code></div></div>
و به روز بشه تا همه راحت بتونن این فریم ورک رو دانلود کنن .]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Excel Helper]]></title>
			<link>http://forum.cakephp.ir/thread-537.html</link>
			<pubDate>Tue, 17 Jan 2012 06:33:26 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-537.html</guid>
			<description><![CDATA[سلام<br />
من مي خوام يكسري ديتا روي يك فايل excel بريزم از هلپر Excel استفاده كردم. ولي اين هلپر واسه من فايل excel توليد نميكنه و در صفحه وب من چيزي شبيه شكل زير نشان مي دهد:<br />
<br />
<img src="http://dc271.4shared.com/img/kgdiISO4/s7/0.18557868171601588/Capture.JPG" border="0" alt="[تصویر: Capture.JPG]" /><br />
<br />
همچنين كد زير كه در هلپر نوشته شده در view خوانده نمي شود:<br />
header("Content-type: application/vnd.ms-excel"); <br />
        header('Content-Disposition: attachment;filename="'.&#36;title.'.xls"');<br />
        header('Cache-Control: max-age=0');<br />
        &#36;objWriter = new PHPExcel_Writer_Excel5(&#36;this-&gt;xls);<br />
        &#36;objWriter-&gt;setTempDir(TMP);<br />
        &#36;objWriter-&gt;save('php://output');<br />
<br />
ميشه يك هلپر خوب براي اين كار به من معرفي كنيد.]]></description>
			<content:encoded><![CDATA[سلام<br />
من مي خوام يكسري ديتا روي يك فايل excel بريزم از هلپر Excel استفاده كردم. ولي اين هلپر واسه من فايل excel توليد نميكنه و در صفحه وب من چيزي شبيه شكل زير نشان مي دهد:<br />
<br />
<img src="http://dc271.4shared.com/img/kgdiISO4/s7/0.18557868171601588/Capture.JPG" border="0" alt="[تصویر: Capture.JPG]" /><br />
<br />
همچنين كد زير كه در هلپر نوشته شده در view خوانده نمي شود:<br />
header("Content-type: application/vnd.ms-excel"); <br />
        header('Content-Disposition: attachment;filename="'.&#36;title.'.xls"');<br />
        header('Cache-Control: max-age=0');<br />
        &#36;objWriter = new PHPExcel_Writer_Excel5(&#36;this-&gt;xls);<br />
        &#36;objWriter-&gt;setTempDir(TMP);<br />
        &#36;objWriter-&gt;save('php://output');<br />
<br />
ميشه يك هلپر خوب براي اين كار به من معرفي كنيد.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[کدوم فریم ورک؟]]></title>
			<link>http://forum.cakephp.ir/thread-536.html</link>
			<pubDate>Mon, 16 Jan 2012 05:17:55 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-536.html</guid>
			<description><![CDATA[سلام<br />
وقتتون بخیر<br />
<br />
چند تا از بررسی هاتون (saleh)در مورد فریم ورک ها رو خوندم<br />
<br />
من تا الان پی اچ پی کار میکردم اونم با سی ام اس<br />
الان میخوام رو فریم ورک کار کنم<br />
میخواستم ببینم الان چه فریم ورکی رو پیشنهاد میدین؟<br />
<br />
این طراحی سه لایه ام وی سی(ماژول-ویو-کنترلر)<br />
خیلی کاربردیه؟و واقعا مفیده؟<br />
<br />
چون طراحی سه لایه هم تا حالا کار نکردم<br />
مرسی<br />
لطف میکنید راهنمائیم کنید]]></description>
			<content:encoded><![CDATA[سلام<br />
وقتتون بخیر<br />
<br />
چند تا از بررسی هاتون (saleh)در مورد فریم ورک ها رو خوندم<br />
<br />
من تا الان پی اچ پی کار میکردم اونم با سی ام اس<br />
الان میخوام رو فریم ورک کار کنم<br />
میخواستم ببینم الان چه فریم ورکی رو پیشنهاد میدین؟<br />
<br />
این طراحی سه لایه ام وی سی(ماژول-ویو-کنترلر)<br />
خیلی کاربردیه؟و واقعا مفیده؟<br />
<br />
چون طراحی سه لایه هم تا حالا کار نکردم<br />
مرسی<br />
لطف میکنید راهنمائیم کنید]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[لطفا یه سیستم تحت وب ارسال SMS که با کیک نوشته شده معرفی کنید]]></title>
			<link>http://forum.cakephp.ir/thread-535.html</link>
			<pubDate>Sun, 15 Jan 2012 11:54:01 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-535.html</guid>
			<description><![CDATA[لطفا یه سیستم تحت وب ارسال SMS که فریم ورک با کیک نوشته شده معرفی کنید.]]></description>
			<content:encoded><![CDATA[لطفا یه سیستم تحت وب ارسال SMS که فریم ورک با کیک نوشته شده معرفی کنید.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[رادیو باکس برای find('list')]]></title>
			<link>http://forum.cakephp.ir/thread-534.html</link>
			<pubDate>Sun, 15 Jan 2012 02:48:24 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-534.html</guid>
			<description><![CDATA[سلام<br />
زمانیکه از دستور زیر استفاده می کنیم.<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&#36;usergroups&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Topic</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Usergroup</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">find</span><span style="color: #007700">(</span><span style="color: #DD0000">'list'</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div>
در قسمت view در قالب یه لیست کشویی نمایش میده!<br />
سوال من اینجاست که میشه به جای استفاده از لیست کشویی از رادیو باکس استفاده کرد!<br />
یعنی هر کدام از ایتم هایی که در متغیر &#36;usergroups وجود دارد به صورت یک رادبو باکس باشه]]></description>
			<content:encoded><![CDATA[سلام<br />
زمانیکه از دستور زیر استفاده می کنیم.<br />
<div class="codeblock phpcodeblock"><div class="title">کد PHP:<br />
</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&#36;usergroups&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Topic</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Usergroup</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">find</span><span style="color: #007700">(</span><span style="color: #DD0000">'list'</span><span style="color: #007700">);&nbsp;<br /></span></code></div></div></div>
در قسمت view در قالب یه لیست کشویی نمایش میده!<br />
سوال من اینجاست که میشه به جای استفاده از لیست کشویی از رادیو باکس استفاده کرد!<br />
یعنی هر کدام از ایتم هایی که در متغیر &#36;usergroups وجود دارد به صورت یک رادبو باکس باشه]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[كدوم نسخه از كيك رو دانلود كنم]]></title>
			<link>http://forum.cakephp.ir/thread-533.html</link>
			<pubDate>Sat, 14 Jan 2012 08:38:44 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-533.html</guid>
			<description><![CDATA[با سلام.<br />
من با كيك هيچ آشنايي ندارم . تازه ميخوام شروع كنم.<br />
به نظر شما كدوم نسخه رو دانلود كنم؟<br />
بعد تو انجمن ديدم كه براي نسخه 2 اين لينك رو گذاشته بوديد <br />
<a href="http://cakephp.ir/download/2.0.5.zip" target="_blank">http://cakephp.ir/download/2.0.5.zip</a><br />
ولي تو سايت اصليش ديدم كه 2.1 آلفا گذاشته<br />
كدومشون بهتره ؟ <br />
اگه قراره باشه  مثلاً از نسخه 2 يا 1.3  و .... استفاده كنم از كدومشون بايد استفاده بشه؟<br />
آيا اگر پروژه اي كه با نسخه 2.0.5 نوشته بشه براي اينكه با نسخه هاي بعدي كه به روز ميشن بخواي استفاده كني بايد تغييرات زيادي بدي؟<br />
يا تاثيري نداره؟<br />
با تشكر]]></description>
			<content:encoded><![CDATA[با سلام.<br />
من با كيك هيچ آشنايي ندارم . تازه ميخوام شروع كنم.<br />
به نظر شما كدوم نسخه رو دانلود كنم؟<br />
بعد تو انجمن ديدم كه براي نسخه 2 اين لينك رو گذاشته بوديد <br />
<a href="http://cakephp.ir/download/2.0.5.zip" target="_blank">http://cakephp.ir/download/2.0.5.zip</a><br />
ولي تو سايت اصليش ديدم كه 2.1 آلفا گذاشته<br />
كدومشون بهتره ؟ <br />
اگه قراره باشه  مثلاً از نسخه 2 يا 1.3  و .... استفاده كنم از كدومشون بايد استفاده بشه؟<br />
آيا اگر پروژه اي كه با نسخه 2.0.5 نوشته بشه براي اينكه با نسخه هاي بعدي كه به روز ميشن بخواي استفاده كني بايد تغييرات زيادي بدي؟<br />
يا تاثيري نداره؟<br />
با تشكر]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[مشکل با TinyMCE]]></title>
			<link>http://forum.cakephp.ir/thread-532.html</link>
			<pubDate>Fri, 13 Jan 2012 09:02:07 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-532.html</guid>
			<description><![CDATA[من از ادیتور TinyMCE استفاده کرده ام و روی لوکال مشکلی نیست اما قتی فایل ها روی هاست قرار می گیرد TinyMCE کار نمی کند .]]></description>
			<content:encoded><![CDATA[من از ادیتور TinyMCE استفاده کرده ام و روی لوکال مشکلی نیست اما قتی فایل ها روی هاست قرار می گیرد TinyMCE کار نمی کند .]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[معادل فارسی اصطلاحات اصلی ]]></title>
			<link>http://forum.cakephp.ir/thread-530.html</link>
			<pubDate>Thu, 12 Jan 2012 14:04:10 -0600</pubDate>
			<guid isPermaLink="false">http://forum.cakephp.ir/thread-530.html</guid>
			<description><![CDATA[در زمان خواندن مطالبی در مورد کیک از منابع لاتین همزمان ترجمه فارسی آنها را یادداشت می کنم شاید بعدها مورد استفاده قرار گیرد.<br />
 با یک مشکلی مواجه شده ام و آنهم عدم اتفاق در مورد معادل فارسی لغات اصلی مانند کامپوننت، کنترلر،.. در سایت های مختلف است<br />
پیشنهاد می کنم گروهی از دوستان واژگان اصلی مورد استفاده در کیک را ترجمه و در اختیار عموم قرار دهند.<br />
تا در مقالات مختلف یکنواختی حاکم شود<br />
<br />
به قول آن استاد بزرگ : آنچه می نویسم نشانه دانایی من نیست، نشانه آنچه می دانم است.<br />
<br />
و من می گویم:<br />
حرفهایم از علم من نیست از بی اطلاعی من است]]></description>
			<content:encoded><![CDATA[در زمان خواندن مطالبی در مورد کیک از منابع لاتین همزمان ترجمه فارسی آنها را یادداشت می کنم شاید بعدها مورد استفاده قرار گیرد.<br />
 با یک مشکلی مواجه شده ام و آنهم عدم اتفاق در مورد معادل فارسی لغات اصلی مانند کامپوننت، کنترلر،.. در سایت های مختلف است<br />
پیشنهاد می کنم گروهی از دوستان واژگان اصلی مورد استفاده در کیک را ترجمه و در اختیار عموم قرار دهند.<br />
تا در مقالات مختلف یکنواختی حاکم شود<br />
<br />
به قول آن استاد بزرگ : آنچه می نویسم نشانه دانایی من نیست، نشانه آنچه می دانم است.<br />
<br />
و من می گویم:<br />
حرفهایم از علم من نیست از بی اطلاعی من است]]></content:encoded>
		</item>
	</channel>
</rss>
