<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Frameworks &#187; cakephp</title>
	<atom:link href="http://www.phpframeworks.com/news/p/category/cakephp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phpframeworks.com/news</link>
	<description>We compare all kinds of PHP frameworks and help you choose the right php framework for your project.</description>
	<lastBuildDate>Sat, 11 Feb 2012 04:00:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Codelobster PHP Edition – free PHP IDE with support all popular frameworks</title>
		<link>http://www.phpframeworks.com/news/p/30807/codelobster-free-php-ide-editor</link>
		<comments>http://www.phpframeworks.com/news/p/30807/codelobster-free-php-ide-editor#comments</comments>
		<pubDate>Wed, 22 Jun 2011 08:57:08 +0000</pubDate>
		<dc:creator>clod</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Development tools]]></category>
		<category><![CDATA[Industry News]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[Codelobster]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpframeworks.com/news/?p=30807</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/30807/codelobster-free-php-ide-editor">Codelobster PHP Edition – free PHP IDE with support all popular frameworks</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>
Codelobster PHP Edition – free PHP IDE with support all popular frameworks is a post from: PHP Frameworks
To be able to work fully on web sites development you obviously need a modern and convenient editor. There is a plenty of proprietary software for that, but we would like to emphasize software free absolutely which has [...]]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/30807/codelobster-free-php-ide-editor/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lexa-tools framework for PHP 5.3</title>
		<link>http://www.phpframeworks.com/news/p/29587/lexa-tools-framework-for-php-5-3</link>
		<comments>http://www.phpframeworks.com/news/p/29587/lexa-tools-framework-for-php-5-3#comments</comments>
		<pubDate>Sat, 04 Jun 2011 05:50:22 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Development tools]]></category>
		<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Introduction]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[New Frameworks Report]]></category>
		<category><![CDATA[PHP Ajax Framework]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[Top 10 PHP Frameworks]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php framework comparison]]></category>
		<category><![CDATA[best php framework]]></category>
		<category><![CDATA[fastest php framework]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[lexa-tools]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php framework]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[which is the best php framework]]></category>

		<guid isPermaLink="false">http://www.phpframeworks.com/news/?p=29587</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/29587/lexa-tools-framework-for-php-5-3">lexa-tools framework for PHP 5.3</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>
lexa-tools framework for PHP 5.3 is a post from: PHP Frameworks
lexa-tools library is not as much a framework as a set of utililies (tools). You are free to organize the site as you’d like. No special folder structure is required. No need to declare any classes. No config files and no magic conventions. The library [...]]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/29587/lexa-tools-framework-for-php-5-3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using DISTINCT in a CakePHP find function</title>
		<link>http://www.phpframeworks.com/news/p/1266/using-distinct-in-a-cakephp-find-function</link>
		<comments>http://www.phpframeworks.com/news/p/1266/using-distinct-in-a-cakephp-find-function#comments</comments>
		<pubDate>Wed, 11 Nov 2009 22:22:35 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[distinct]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[list]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1718482/using-distinct-in-a-cakephp-find-function</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1266/using-distinct-in-a-cakephp-find-function">Using DISTINCT in a CakePHP find function</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>Hello,</p>

<p>I am writing a CakePHP 1.2 app.  I have a list of people that I want the user to be able to filter on different fields.  For each filterable field, I have a drop down list.  Choose the filter combination, click filter, and the page shows only the records that match.</p>

<p>In people_controller, I have this bit of code:</p>

<pre><code>$first_names = $this-&#62;Person-&#62;find('list', array(
    'fields'=&#62;'first_name',
    'order'=&#62;'Person.first_name ASC',
    'conditions'=&#62; array('Person.status'=&#62;'1')
));
$this-&#62;set('first_names', $first_names);
</code></pre>

<p>(Status = 1 because I am using a soft delete.)</p>

<p>That creates an ordered list of all first_names.  But duplicates are in there.</p>

<p>Digging around in the Cookbook, I found an example using the DISTINCT keyword and modified my code to use it.</p>

<pre><code>$first_names = $this-&#62;Person-&#62;find('list', array(
    'fields'=&#62;'DISTINCT first_name',
    'order'=&#62;'Person.first_name ASC',
    'conditions'=&#62; array('Person.status'=&#62;'1')
));
</code></pre>

<p>This gives me an SQL error like this:</p>

<pre><code>Query: SELECT `Person`.`id`, DISTINCT `Person`.` first_name` FROM `people` AS `Person`   WHERE `Person`.`status` = 1   ORDER BY `Person`.`first_name` ASC
</code></pre>

<p>The problem is obvious.  The framework is adding Person.id to the query.  I suspect this comes from using 'list'.</p>

<p>I will use the selected filter to create an SQL statement when the filter button is clicked.  I don't need the is field, but can't get rid of it.</p>

<p>Thank you,
Frank Luke</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1266/using-distinct-in-a-cakephp-find-function/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>getting referer from auth in cakePHP</title>
		<link>http://www.phpframeworks.com/news/p/1259/getting-referer-from-auth-in-cakephp</link>
		<comments>http://www.phpframeworks.com/news/p/1259/getting-referer-from-auth-in-cakephp#comments</comments>
		<pubDate>Wed, 11 Nov 2009 17:46:49 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[referer]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1716901/getting-referer-from-auth-in-cakephp</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1259/getting-referer-from-auth-in-cakephp">getting referer from auth in cakePHP</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>I have a link on the main page that is only accessible if they are logged in. However, if this link is clicked, I want to show a custom error message on the login page (a custom 'Message.auth'). </p>

<p>i.e. I want (pseudo code)</p>

<pre><code>if (referer == '/users/reserve'){
    Message.auth = 'Please log in to reserve tickets';
}
else {
    Message.auth = 'Please log in to access that page';
}
</code></pre>

<p>Where would I put this bit of code?</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1259/getting-referer-from-auth-in-cakephp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Action called from many other places, how to handle a &#8220;Back&#8221; button?</title>
		<link>http://www.phpframeworks.com/news/p/1257/action-called-from-many-other-places-how-to-handle-a-back-button</link>
		<comments>http://www.phpframeworks.com/news/p/1257/action-called-from-many-other-places-how-to-handle-a-back-button#comments</comments>
		<pubDate>Wed, 11 Nov 2009 15:03:06 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1715746/action-called-from-many-other-places-how-to-handle-a-back-button</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1257/action-called-from-many-other-places-how-to-handle-a-back-button">Action called from many other places, how to handle a &#8220;Back&#8221; button?</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>I have an action (view for example) in a controller that is called from multiple other actions in other controllers.  How is the best way to create a "Back" button that will take me back to the page that got me here?</p>

<p>I've used named parameters like "back_controller" and "back_action" and that works fairly well but they get awkward when the page has a form that gets submitted. I have to be sure to pass those parameters as hidden fields or in the form url and then look for them after the form has been processed.</p>

<p>Is there some kind of stack or other solution that anyone else has come up with that handles this situation better?  I see this problem in a lot of my projects and I've yet to come up with a good solution.</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1257/action-called-from-many-other-places-how-to-handle-a-back-button/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to set a selected value in $form-&gt;select function? need help</title>
		<link>http://www.phpframeworks.com/news/p/1251/how-to-set-a-selected-value-in-form-select-function-need-help</link>
		<comments>http://www.phpframeworks.com/news/p/1251/how-to-set-a-selected-value-in-form-select-function-need-help#comments</comments>
		<pubDate>Wed, 11 Nov 2009 09:42:36 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1714122/how-to-set-a-selected-value-in-form-select-function-need-help</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1251/how-to-set-a-selected-value-in-form-select-function-need-help">how to set a selected value in $form-&gt;select function? need help</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>in my edit function, i need to reselect for the field again to save it.
how can i added a 'selected'=&#62;$addresscountry field in my $form-&#62;select function??</p>

<p>this is my code..</p>

<blockquote>
  <p>echo
  $country-&#62;select('Address.txtother_country','Please
  Choose Your Country'</p>
</blockquote>

<p>which $country is 1 of the helper that include by the page, let user to select country.
i need it automatic to refer back to the previous data which had save, means add a selected value in my edit function.</p>

<p>any 1 can help? thanks..</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1251/how-to-set-a-selected-value-in-form-select-function-need-help/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cake PHP pagination problem</title>
		<link>http://www.phpframeworks.com/news/p/1249/cake-php-pagination-problem</link>
		<comments>http://www.phpframeworks.com/news/p/1249/cake-php-pagination-problem#comments</comments>
		<pubDate>Wed, 11 Nov 2009 07:18:31 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1713579/cake-php-pagination-problem</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1249/cake-php-pagination-problem">Cake PHP pagination problem</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>I have a controller and view. 
in the view it will displays all the records frm the database. 
also there is a searchby  form in the top of that view page. 
if we specify a search term, and submit the form , the view will only displays the records resulting from that search. 
the results are paginated. 
but the problem is  when i perform a search and click on the next page of the results , it will shows all the results ..  here is my code.</p>

<p>View page
index.ctp</p>

<pre><code>echo $form-&#62;create('Apartment', array('action'=&#62;'index'));
echo form-&#62;input('searchBy',array('type'=&#62;'select','options'=&#62;array('Id'=&#62;'Id','User'=&#62;'User','time'=&#62;'Updated time')));
echo $form-&#62;input('query', array('type'=&#62;'text', 'label'=&#62;'Search Term'));
echo $form-&#62;end(array('name'=&#62;'submit', 'label'=&#62;'Search'));




&#60;th class="actions"&#62;&#60;?php __('');?&#62;&#60;/th&#62;
&#60;th&#62;&#60;?php echo $paginator-&#62;sort('id');?&#62;&#60;/th&#62;
&#60;th&#62;&#60;?php echo $paginator-&#62;sort('Headline');?&#62;&#60;/th&#62;
&#60;th&#62;&#60;?php echo $paginator-&#62;sort('Campaign','Campaign.Name');?&#62;&#60;/th&#62;
&#60;th&#62;&#60;?php echo $paginator-&#62;sort('User', 'User.name');?&#62;&#60;/th&#62;
&#60;th&#62;&#60;?php echo $paginator-&#62;sort('modified');?&#62;&#60;/th&#62;
&#60;th&#62;&#60;?php echo $paginator-&#62;sort('status');?&#62;&#60;/th&#62;
&#60;th class="actions"&#62;&#60;?php __('Actions');?&#62;&#60;/th&#62;
</code></pre>

<p>Controller  index function</p>

<pre><code>if (!empty($this-&#62;data)) {
// Search 
switch($this-&#62;data['Apartment']['searchBy'])
{
case 'Id':
        $apartments = $this-&#62;paginate(NULL, array('Apartment.id' =&#62; $this-&#62;data['Apartment']['query']));
        break;
case 'User':
	$apartments = $this-&#62;paginate(NULL, array("User.name Like '%".$this-&#62;data['Apartment']['query']."%'"));
	break
case 'time':
	$apartments = $this-&#62;paginate(NULL, array("Apartment.modified Like '%".$this-&#62;data['Apartment']['query']."%'"));
	break;
}
}
else {
        $apartments = $this-&#62;paginate();
}
</code></pre>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1249/cake-php-pagination-problem/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter vs CakePHP vs ZendFramework vs Symfony(In Chinese)</title>
		<link>http://www.phpframeworks.com/news/p/1244/codeigniter-vs-cakephp-vs-zendframework-vs-symfonyin-chinese</link>
		<comments>http://www.phpframeworks.com/news/p/1244/codeigniter-vs-cakephp-vs-zendframework-vs-symfonyin-chinese#comments</comments>
		<pubDate>Wed, 11 Nov 2009 06:48:11 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[zendframework]]></category>

		<guid isPermaLink="false">http://www.phpframeworks.com/news/?p=1244</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1244/codeigniter-vs-cakephp-vs-zendframework-vs-symfonyin-chinese">CodeIgniter vs CakePHP vs ZendFramework vs Symfony(In Chinese)</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>
CodeIgniter vs CakePHP vs ZendFramework vs Symfony(In Chinese) is a post from: PHP Frameworks
【IT168技术分析评论】　
最近简单的使用了目前在国内用的比较多的几个主流国外PHP框架(不包括国内框架)，大致对这些框架有个直观上的感受，简单分享一下，对于哪些做框架选型的时候，权当一个参考。
主要参考的框架包括：CodeIgniter、CakePHP、ZendFramework、Symfony
说明：我对很多框架也没有认真使用，只是简单试用了一下，可能很多看法不成熟或者是错误的，请大家指正，一起成长。
【 CodeIgniter 】
官方网站：http://codeigniter.com
中文网站：http://codeigniter.org.cn
中文手册：http://codeigniter.org.cn/user_guide
视频教程：http://codeigniter.org.cn/tutorials
测试版本：CodeIgniter_1.6.1
优点：
1. 配置简单，全部的配置使用PHP脚本来配置，执行效率高;具有基本的路由功能，能够进行一定程度的路由;具有初步的Layout功能，能够制作一定程度的界面外观;数据库层封装的不错，具有基本的MVC功能
2. 快速简洁，代码不多，执行性能高，框架简单，容易上手，学习成本低，文档详细;自带了很多简单好用的library，框架适合小型应用
缺点：
1. 把Model层简单的理解为数据库操作
2. 框架略显简单，只能够满足小型应用，略微不太能够满足中型应用需要
评价：
总体来说，拿CodeIgniter来完成简单快速的应用还是值得，同时能够构造一定程度的layout，便于模板的复用，数据操作层来说封装的不错，并且CodeIgniter没有使用很多太复杂的设计模式，执行性能和代码可读性上都不错。至于附加的 library 也还不错，简洁高效。
【 CakePHP 】
官方网站：http://www.cakephp.org
中文手册：http://www.1&#215;3x.net/cakephp
视频教程：http://search.you.video.sina.com.cn/s?key=cakephp
测试版本：cake_1.1.19.6305
优点：
1. CakePHP是最类似于RoR的框架，包括设计方式，数据库操作的Active Record方式;设计层面很优雅，没有自带多余的 library，所有的功能都是纯粹的框架，执行效率还不错;数据库层的 hasOne, hasMany 功能很强大，对于复杂业务处理比较合适;路由功能，配置功能还不错;自动构建脚手架(scaffold)很强大;适合中型应用;基本实现过了MVC每一层;具有自动操作命令行脚本功能;
2. 文档比较全，在国内推广的比较成功，大部分都知道CakePHP，学习成本中等
缺点：
1. CakePHP非常严重的问题是把Model理解为数据库层操作，严重影响了除了数据库之外的操作能力
2. CakePHP的cache功能略显薄弱，配置功能稍嫌弱;CakePHP不适合大型应用，只适合中型应用，小型应用来说略微的学习成本高了点
评价：
总体来说CakePHP框架代表了PHP框架很重要的一个时代和代表，并且目前发挥着很重要的作用，不少自己写的框架都模仿了CakePHP的方式，是个里程碑式的产品;CakePHP透露着RoR的敏捷开发方式和把数据库操作认为是唯一Model的设计思想，作为开发快速应用和原型是绝好的工具;同样，用来做Web2.0网站的开发框架，也是值得选择的。
【 Zend Framework 】
官方网站：http://framework.zend.com
中文手册：http://www.phpeye.com/zf
视频教程：http://framework.zend.com/docs/screencasts
测试版本：ZendFramework-1.5.0
优点：
1. 官方出品，自带了非常多的 library，框架本身使用了很多设计模式来编写，架构上很优雅，执行效率中等;MVC设计中，比较简洁，具有路由功能，配置文件比较强大(能够处理 XML和php INI)，各种 library 很强大，是所有PHP框架中各种功能最全面的，包括它不仅是一个框架，更是一个大类库(取代PEAR)，这是它的主要特色;能够直观的支持除数据库操作之外的Model层(比 CodeIgniter 和 CakePHP 强)，并且能够很轻易的使用Loader功能加载其他新增加的Class;Cache功能很强大，从前端Cache到后端Cache都支持，后端 Cache支持Memcache、APC、SQLite、文件等等方式;数据库操作功能很强大，支持各种驱动(适配器)
2. 文档很全，在国内社区很成熟，并且目前不少Web 2.0网站在使用，学习成本中等
缺点：
1. MVC功能完成比较弱，View层简单实现(跟没实现一样)，无法很强大的控制前端页面
2. 没有自动化脚本，创建一个应用，包括入口文件，全部必须自己手工构建，入门成本高
3. Zend Framework 作为一个中型应用框架问题不大，也能够勉强作为大型应用的框架，但是作为一个很成熟的大型PHP框架来说，还需要一些努力
评价：
作为官方出品的框架，Zend Framework的野心是可以预见的，想把其他框架挤走，同时封装很多强大的类库，能够提供一站式的框架服务，并且他们的开发团队很强大，完全足够有能力开发很强大的产品出来，所以基本可以确定的是Zend [...]]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1244/codeigniter-vs-cakephp-vs-zendframework-vs-symfonyin-chinese/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>set a default saving data in a selection box in HABTM model</title>
		<link>http://www.phpframeworks.com/news/p/1248/set-a-default-saving-data-in-a-selection-box-in-habtm-model</link>
		<comments>http://www.phpframeworks.com/news/p/1248/set-a-default-saving-data-in-a-selection-box-in-habtm-model#comments</comments>
		<pubDate>Wed, 11 Nov 2009 04:44:47 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1713064/set-a-default-saving-data-in-a-selection-box-in-habtm-model</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1248/set-a-default-saving-data-in-a-selection-box-in-habtm-model">set a default saving data in a selection box in HABTM model</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>here is my problem which in my system.</p>

<p>my system allow user to add event, which include date, time, places. In the other hand, user are allow to choose the "Event sharing to" some of other user. So i successful to created and share to other user, when the user login which are being choose to share with the event, he is able to view for that particular event. </p>

<p>But the problem is, when user add the event, he must choose for his own name also in the select box. If not he will be unable to read the event that he had created.</p>

<p>So i need to save a default data to my model, which is whenever the user got choose the sharing event or not, it also will save the data to his user id.</p>

<p>here is my code for select box, what can i edit and do to let it set a default saving value which is always save with the user own data??</p>

<blockquote>
  <p>input('User',array( 'label' =&#62; 'Select Related
  Potential',   'options' =&#62; $users,
    //'id'=&#62;'user',
    'style'=&#62;'width:250px;height:100px',
    //'selected' =&#62; $ownUserId )); ?&#62;</p>
</blockquote>

<p>i try to solve by adding 1 more row to the add.ctp, but the permission just set to the own user who created it, the other user i choose is unable to read.</p>

<blockquote>
  <p>$form-&#62;input('User',array(
  'label' =&#62; 'Select Related Potential',
  'options' =&#62; $users, //'id'=&#62;'user',
  'style'=&#62;'width:250px;height:100px',
  'selected' =&#62; $ownUserId ));</p>
  
  <p>$form-&#62;input('User',array('type'=&#62;'hidden','value'=&#62;$ownUserId));</p>
</blockquote>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1248/set-a-default-saving-data-in-a-selection-box-in-habtm-model/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is it possible to store the fields of one Array as a new array?</title>
		<link>http://www.phpframeworks.com/news/p/1237/is-it-possible-to-store-the-fields-of-one-array-as-a-new-array</link>
		<comments>http://www.phpframeworks.com/news/p/1237/is-it-possible-to-store-the-fields-of-one-array-as-a-new-array#comments</comments>
		<pubDate>Wed, 11 Nov 2009 01:05:08 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1712350/is-it-possible-to-store-the-fields-of-one-array-as-a-new-array</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1237/is-it-possible-to-store-the-fields-of-one-array-as-a-new-array">Is it possible to store the fields of one Array as a new array?</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>Hi everyone,</p>

<p>In my CakePHP app, I'm pulling in the results of a table called 'Timesheets'. This table has an athlete_id and a few split times for a race. I need to do some calculations on one athlete's times compared to another athlete (for instance, calculate the difference between the fastest finish time and slowest). </p>

<p>I thought the best way to do this would be to store every athletes 'finish' in a new array, then run the min() function on it. For the life of me, I can't get this to work...</p>

<p>Do you think I am approaching this the wrong way, or am I just missing something?</p>

<pre><code>foreach ($timesheet['Run'] as $run):
	&#60;tr&#60;?php echo $class;?&#62;&#62;
		&#60;td&#62;&#60;?php echo $run['athlete_id'];?&#62;&#60;/td&#62;
		&#60;td&#62;&#60;?php echo $run['start'];?&#62;&#60;/td&#62;
		&#60;td&#62;&#60;?php echo $run['split1'];?&#62;&#60;/td&#62;
		&#60;td&#62;&#60;?php echo $run['split2'];?&#62;&#60;/td&#62;
		&#60;td&#62;&#60;?php echo $run['split3'];?&#62;&#60;/td&#62;
		&#60;td&#62;&#60;?php echo $run['split4'];?&#62;&#60;/td&#62;
		&#60;td&#62;&#60;?php echo $run['split5'];?&#62;&#60;/td&#62;
		&#60;td&#62;&#60;?php echo $run['split6'];?&#62;&#60;/td&#62;
		&#60;td&#62;&#60;?php echo $run['finish'];?&#62;&#60;/td&#62;
    &#60;/tr&#62;
   endforeach
</code></pre>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1237/is-it-possible-to-store-the-fields-of-one-array-as-a-new-array/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assistance with CakePHP model relationships</title>
		<link>http://www.phpframeworks.com/news/p/1234/assistance-with-cakephp-model-relationships</link>
		<comments>http://www.phpframeworks.com/news/p/1234/assistance-with-cakephp-model-relationships#comments</comments>
		<pubDate>Tue, 10 Nov 2009 21:31:01 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1711354/assistance-with-cakephp-model-relationships</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1234/assistance-with-cakephp-model-relationships">Assistance with CakePHP model relationships</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>How would I represent the following in a CakePHP model?</p>

<pre><code>Product
=======
product_id
....

Cart
====
cart_id
....

Carts_Products
==============
cart_id
product_id
quantity
</code></pre>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1234/assistance-with-cakephp-model-relationships/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>how to find out my current user id in other page controller after i login??</title>
		<link>http://www.phpframeworks.com/news/p/1218/how-to-find-out-my-current-user-id-in-other-page-controller-after-i-login</link>
		<comments>http://www.phpframeworks.com/news/p/1218/how-to-find-out-my-current-user-id-in-other-page-controller-after-i-login#comments</comments>
		<pubDate>Tue, 10 Nov 2009 06:36:59 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1706016/how-to-find-out-my-current-user-id-in-other-page-controller-after-i-login</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1218/how-to-find-out-my-current-user-id-in-other-page-controller-after-i-login">how to find out my current user id in other page controller after i login??</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>i am planing to set a permission on my event index page, which just allow certain user to view which had set when i add the event. After user click into my event, the event controller will 1st check the user id and check the event database which control the user can see which event in his calendar. The permission is added when user create a event and share to other user. Beside, how can i find the current user id to compare with my event database which is the accurate 1?</p>

<p>any suggestion for me to did this function?
i need to know the code and concept how i get the current user id to compare with all the event database, and allow the current user see the certain event.</p>

<p>thanks alot for your information.</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1218/how-to-find-out-my-current-user-id-in-other-page-controller-after-i-login/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get weekdays in drop down in cakephp, with a default day selected?</title>
		<link>http://www.phpframeworks.com/news/p/1219/how-to-get-weekdays-in-drop-down-in-cakephp-with-a-default-day-selected</link>
		<comments>http://www.phpframeworks.com/news/p/1219/how-to-get-weekdays-in-drop-down-in-cakephp-with-a-default-day-selected#comments</comments>
		<pubDate>Tue, 10 Nov 2009 06:07:21 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1705932/how-to-get-weekdays-in-drop-down-in-cakephp-with-a-default-day-selected</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1219/how-to-get-weekdays-in-drop-down-in-cakephp-with-a-default-day-selected">How to get weekdays in drop down in cakephp, with a default day selected?</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>Hi all,</p>

<p>I want  the weekdays to be displayed in a drop down in cakephp, with a default
day selected.
My code is as follows
echo $form-&#62;input('Weekday', array('options' =&#62; array
('Monday','Tuesday','Wednesday','Thursday', 'Friday','Saturday',
'Sunday')));
When I do like this it stores 0 value in database instead of day name.
Also I want to set a default selected weekday .
Please help!!!</p>

<p>Thanking you.......... </p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1219/how-to-get-weekdays-in-drop-down-in-cakephp-with-a-default-day-selected/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cakephp is not redirecting properly when pages are cached.</title>
		<link>http://www.phpframeworks.com/news/p/1213/cakephp-is-not-redirecting-properly-when-pages-are-cached</link>
		<comments>http://www.phpframeworks.com/news/p/1213/cakephp-is-not-redirecting-properly-when-pages-are-cached#comments</comments>
		<pubDate>Tue, 10 Nov 2009 00:40:50 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1704948/cakephp-is-not-redirecting-properly-when-pages-are-cached</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1213/cakephp-is-not-redirecting-properly-when-pages-are-cached">Cakephp is not redirecting properly when pages are cached.</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>I am having some issues with a site that was working correctly until i implemented full page caching in CakePHP.</p>

<p>I have followed the guidance in the Manual and have my $session-&#62;flash in a no-cache block as so:</p>

<pre><code>&#60;cake:nocache&#62;
	&#60;? 
	if($session-&#62;check('Message.flash')){
		$session-&#62;flash();
	} 
	?&#62;
&#60;/cake:nocache&#62;
</code></pre>

<p>However, whenever a controller sets a flash message and redirects to a cached page the page loads down to the  tag and no further.. If i then go to a page created by another controller the correct (delayed) message is displayed and the page loads correctly.</p>

<p>Any help would be much appreciated,</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1213/cakephp-is-not-redirecting-properly-when-pages-are-cached/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP assocation question</title>
		<link>http://www.phpframeworks.com/news/p/1211/cakephp-assocation-question</link>
		<comments>http://www.phpframeworks.com/news/p/1211/cakephp-assocation-question#comments</comments>
		<pubDate>Mon, 09 Nov 2009 21:46:11 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1704086/cakephp-assocation-question</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1211/cakephp-assocation-question">CakePHP assocation question</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>I'm creating a small timesheet application. Timesheets have athletes, and each athlete has personal split times (like in running, or race car driving) </p>

<p>An Athlete hasMany Run, a Run belongsTo Athlete, An Athlete hasAndBelongsToMany Timesheets (and vice versa). A Timesheet hasMany Run, and finally a Run belongsTo Timesheet.</p>

<p>When I'm adding new runs in my view, I'm unable to get anything but the athlete_id in the select box. I'd really like to have their names instead. Instead of </p>

<p><code>&#60;?php echo $run['athlete_id'];?&#62;</code>, I've tried <code>&#60;?php echo $athlete['Athlete']['last_name'] ?&#62;</code> but I can't seem to get it to work. Any help would be greatly appreciated. Thanks!</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1211/cakephp-assocation-question/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cakephp: how to access to model &#8220;variables&#8221; (mapped from db) from the controller after a set?</title>
		<link>http://www.phpframeworks.com/news/p/1205/cakephp-how-to-access-to-model-variables-mapped-from-db-from-the-controller-after-a-set</link>
		<comments>http://www.phpframeworks.com/news/p/1205/cakephp-how-to-access-to-model-variables-mapped-from-db-from-the-controller-after-a-set#comments</comments>
		<pubDate>Mon, 09 Nov 2009 17:32:04 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1702533/cakephp-how-to-access-to-model-variables-mapped-from-db-from-the-controller</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1205/cakephp-how-to-access-to-model-variables-mapped-from-db-from-the-controller-after-a-set">Cakephp: how to access to model &#8220;variables&#8221; (mapped from db) from the controller after a set?</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>Ok i have this controller:</p>

<pre><code>class ExampleController extends AppController {

    var $name = 'Example';


    public function test_me () {

      $this-&#62;Example-&#62;Create();

      $this-&#62;Example-&#62;set(  'variable_from_db_1' =&#62; 'random_value_1',
                            'variable_from_db_2' =&#62; 'random_value_2' );


     //here, how can i access to variable_from_db_1 and 2 in $this-&#62;Example?
     //???? i've tried $this-&#62;data and $this-&#62;Example-&#62;data but nothing to do

}

}
</code></pre>

<p>Do you have some hints for me?</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1205/cakephp-how-to-access-to-model-variables-mapped-from-db-from-the-controller-after-a-set/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cakephp + cache query + after refresh lost all data except cachedata</title>
		<link>http://www.phpframeworks.com/news/p/1199/cakephp-cache-query-after-refresh-lost-all-data-except-cachedata</link>
		<comments>http://www.phpframeworks.com/news/p/1199/cakephp-cache-query-after-refresh-lost-all-data-except-cachedata#comments</comments>
		<pubDate>Mon, 09 Nov 2009 11:16:05 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cache]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1700411/cakephp-cache-query-after-refresh-lost-all-data-except-cachedata</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1199/cakephp-cache-query-after-refresh-lost-all-data-except-cachedata">cakephp + cache query + after refresh lost all data except cachedata</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>hello world!<br />
in my controller i cache some paginatedata. after refresh (f5) i get only the data from the cachequeryfile but i lost ALL other data in my view.<br />
why?  </p>

<p><strong>thanks</strong> hansi meier</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1199/cakephp-cache-query-after-refresh-lost-all-data-except-cachedata/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>array conversion in php</title>
		<link>http://www.phpframeworks.com/news/p/1191/array-conversion-in-php</link>
		<comments>http://www.phpframeworks.com/news/p/1191/array-conversion-in-php#comments</comments>
		<pubDate>Mon, 09 Nov 2009 09:53:03 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[ar]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1700049/array-conversion-in-php</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1191/array-conversion-in-php">array conversion in php</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>how would you convert this array:</p>

<pre><code>Array
(
    [0] =&#62; Array
        (
            [Contact] =&#62; Array
                (
                    [number] =&#62; 0425 234 634
                )

        )

    [1] =&#62; Array
        (
            [Contact] =&#62; Array
                (
                    [number] =&#62; 2939 492 235
                )

        )

)
</code></pre>

<p>into this array</p>

<pre><code>Array
(
    [0] =&#62; 0425 234 634
    [1] =&#62; 2939 492 235
)
</code></pre>

<p>?</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1191/array-conversion-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Combining add and replacing values</title>
		<link>http://www.phpframeworks.com/news/p/1187/combining-add-and-replacing-values</link>
		<comments>http://www.phpframeworks.com/news/p/1187/combining-add-and-replacing-values#comments</comments>
		<pubDate>Mon, 09 Nov 2009 04:52:58 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1699153/combining-add-and-replacing-values</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1187/combining-add-and-replacing-values">Combining add and replacing values</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>Im curious to know if php has a function that allows me to connect 2 arrays together and replace values from array1 with values of array2 if the values from array2 already exist. see example</p>

<p>array1('value1','value2','value3',);
array2('value4','value2','value1');</p>

<p>array3 = functionEmerge(array1, array2);</p>

<p>array3('value1','value2','value3','value4',);</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1187/combining-add-and-replacing-values/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>check for error</title>
		<link>http://www.phpframeworks.com/news/p/1181/check-for-error</link>
		<comments>http://www.phpframeworks.com/news/p/1181/check-for-error#comments</comments>
		<pubDate>Sun, 08 Nov 2009 19:56:33 +0000</pubDate>
		<dc:creator>wood</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://stackoverflow.com/questions/1697711/check-for-error</guid>
		<description><![CDATA[<p><a href="http://www.phpframeworks.com/news/p/1181/check-for-error">check for error</a> is a post from: <a href="http://www.phpframeworks.com/">PHP Frameworks</a></p>

            <p>I have my own AppCotroller and using the beforeRender method to make changes to $this-&#62;viewPath based on the desired output format.</p>

<p>Is there a way I can check if Cake is currently outputting an error message? If I change the viewPath and then it's displaying an error (like can't load model, etc) it will error on the error :)</p>

        ]]></description>
		<wfw:commentRss>http://www.phpframeworks.com/news/p/1181/check-for-error/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

