<?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プログラマのバリ・ポジ情報ブログ &#187; CakePHP</title>
	<atom:link href="http://blog.veryposi.info/tag/cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.veryposi.info</link>
	<description>PHP,JavaScriptやサーバーの設定などのプログラミングに関する情報をバリ・ポジティブに発信しているプログラマのブログ、『バリ・ポジ』</description>
	<lastBuildDate>Thu, 10 May 2012 06:23:01 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>CakePHPのfindの第1引数による戻り値の違い</title>
		<link>http://blog.veryposi.info/programing/php/cakephp-find-result/</link>
		<comments>http://blog.veryposi.info/programing/php/cakephp-find-result/#comments</comments>
		<pubDate>Wed, 13 May 2009 04:58:28 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1237</guid>
		<description><![CDATA[CakePHPでfindメソッドを使用した場合の戻り値についてです。 このようになテーブルを作成し、データを登録して検索します。 フィールド 種別 id int(11) name varchar(255) title v [...]]]></description>
			<content:encoded><![CDATA[<p>CakePHPでfindメソッドを使用した場合の戻り値についてです。</p>
<p>このようになテーブルを作成し、データを登録して検索します。</p>
<table border="1" class="layout">
<tbody>
<tr>
<td bgcolor="#99ccff" style="text-align: center;">フィールド</td>
<td bgcolor="#99ccff" style="text-align: center;">種別</td>
</tr>
<tr>
<td>id</td>
<td>int(11)</td>
</tr>
<tr>
<td>name</td>
<td>varchar(255)</td>
</tr>
<tr>
<td>title</td>
<td>varchar(255)</td>
</tr>
<tr>
<td>content</td>
<td>text</td>
</tr>
</tbody>
</table>
<p>&nbsp;findの第1引数が「all」の場合</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre>
</td>
<td class="code">
<pre class="php"><a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
  <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(204, 102, 204);">0</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
  <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;Board&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">4</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
      <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;id&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
      string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;2&quot;</span>
      <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;name&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
      string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">18</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;あんぱんまん&quot;</span>
      <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;title&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
      string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;しょくぱんまん&quot;</span>
      <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;content&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
      string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;かれーぱんまん&quot;</span>
    <span style="color: rgb(102, 204, 102);">}</span>
  <span style="color: rgb(102, 204, 102);">}</span>
<span style="color: rgb(102, 204, 102);">}</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;findの第1引数が「first」の場合</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
7
8
9
10
11
12
13
</pre>
</td>
<td class="code">
<pre class="php"><a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
  <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;Board&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
  <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">4</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;id&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;2&quot;</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;name&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">18</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;あんぱんまん&quot;</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;title&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;しょくぱんまん&quot;</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;content&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;かれーぱんまん&quot;</span>
  <span style="color: rgb(102, 204, 102);">}</span>
<span style="color: rgb(102, 204, 102);">}</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>findの第1引数が「list」の場合</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
</pre>
</td>
<td class="code">
<pre class="php"><a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
  <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(204, 102, 204);">2</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
  string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;しょくぱんまん&quot;</span>
<span style="color: rgb(102, 204, 102);">}</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>findの第1引数が「count」の場合</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="php">
int<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/cakephp-find-result/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHPのControllerの命名規則</title>
		<link>http://blog.veryposi.info/programing/php/cakephp-controller/</link>
		<comments>http://blog.veryposi.info/programing/php/cakephp-controller/#comments</comments>
		<pubDate>Wed, 06 May 2009 13:59:53 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1235</guid>
		<description><![CDATA[CakePHPでのControllerの命名規則です。 例）hello_controller.php 1 2 3 4 5 6 7 8 9 10 11 &#60;?php class HelloController exte [...]]]></description>
			<content:encoded><![CDATA[<p>CakePHPでのControllerの命名規則です。</p>
<p>例）hello_controller.php</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
7
8
9
10
11
</pre>
</td>
<td class="code">
<pre class="php"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;?php</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">class</span> HelloController <span style="color: rgb(0, 0, 0); font-weight: bold;">extends</span> AppController <span style="color: rgb(102, 204, 102);">{</span>
&nbsp;
    <span style="color: rgb(0, 0, 0); font-weight: bold;">public</span> <span style="color: rgb(0, 0, 255);">$name</span> = <span style="color: rgb(255, 0, 0);">'Hello'</span>;
&nbsp;
    <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> index<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>
    <span style="color: rgb(102, 204, 102);">{</span>
        <a href="http://www.php.net/echo"><span style="color: rgb(0, 0, 102);">echo</span></a> <span style="color: rgb(255, 0, 0);">&quot;hello world!&quot;</span>;
    <span style="color: rgb(102, 204, 102);">}</span>
<span style="color: rgb(102, 204, 102);">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">?&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>「AppController」を継承するコントローラーを作成します。</p>
<p>クラス名：&lt;名前&gt;Controller</p>
<p>ファイル名：&lt;名前&gt;_controller.php</p>
<p>となります。</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/cakephp-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHPでNot Foundになってしまった場合</title>
		<link>http://blog.veryposi.info/programing/php/cakephp-notfound/</link>
		<comments>http://blog.veryposi.info/programing/php/cakephp-notfound/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 04:57:47 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1218</guid>
		<description><![CDATA[symfony、codeigniterなどのPHPフレームワークを使用したことがあったけど、CakePHPは使用したことがなかった。 symfonyを最近は仕事で使っていてなんか大規模システムを構築するのにあってそうなイ [...]]]></description>
			<content:encoded><![CDATA[<p>symfony、codeigniterなどのPHPフレームワークを使用したことがあったけど、CakePHPは使用したことがなかった。</p>
<p>symfonyを最近は仕事で使っていてなんか大規模システムを構築するのにあってそうなイメージを感じた。</p>
<p>今度、CakePHPで仕事をする可能性があるので勉強します。</p>
<p>でとりあえず動かそうとしたとき</p>
<p>「http://192.168.106.10/hashizume/cake/」でシステムにアクセスしたら</p>
<p><span style="background-color: rgb(255, 255, 153);">404 Not Found</span>が表示された・・・<img alt="" src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/shock.gif" />どおして。</p>
<p>&nbsp;</p>
<p>調べていると.htaccessのRewriteBaseが「/」であることが前提となっているみたいなので修正しました。</p>
<p>修正箇所はRewriteBaseの行を追加しました。</p>
<p>&nbsp;</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
</pre>
</td>
<td class="code">
<pre class="div">
&lt;IfModule mod_rewrite.c&gt;
   RewriteEngine on
   RewriteBase    /hashizume/cake/
   RewriteRule    ^$ app/webroot/    <span style="color: rgb(68, 170, 68);">[</span>L<span style="color: rgb(68, 170, 68);">]</span>
   RewriteRule    <span style="color: rgb(68, 170, 68);">(</span>.*<span style="color: rgb(68, 170, 68);">)</span> app/webroot/$<span style="color: rgb(204, 102, 204);">1</span> <span style="color: rgb(68, 170, 68);">[</span>L<span style="color: rgb(68, 170, 68);">]</span>
&lt;/IfModule&gt;</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
</pre>
</td>
<td class="code">
<pre class="div">
&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine on
    RewriteBase    /hashizume/cake/app/
    RewriteRule    ^$    webroot/    <span style="color: rgb(68, 170, 68);">[</span>L<span style="color: rgb(68, 170, 68);">]</span>
    RewriteRule    <span style="color: rgb(68, 170, 68);">(</span>.*<span style="color: rgb(68, 170, 68);">)</span> webroot/$<span style="color: rgb(204, 102, 204);">1</span>    <span style="color: rgb(68, 170, 68);">[</span>L<span style="color: rgb(68, 170, 68);">]</span>
&lt;/IfModule&gt;</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
7
</pre>
</td>
<td class="code">
<pre class="div">
&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteBase /hashizume/cake/app/webroot/
    RewriteCond %<span style="color: rgb(68, 170, 68);">{</span>REQUEST_FILENAME<span style="color: rgb(68, 170, 68);">}</span> !-d
    RewriteCond %<span style="color: rgb(68, 170, 68);">{</span>REQUEST_FILENAME<span style="color: rgb(68, 170, 68);">}</span> !-f
    RewriteRule ^<span style="color: rgb(68, 170, 68);">(</span>.*<span style="color: rgb(68, 170, 68);">)</span>$ index.php?url=$<span style="color: rgb(204, 102, 204);">1</span> <span style="color: rgb(68, 170, 68);">[</span>QSA,L<span style="color: rgb(68, 170, 68);">]</span>
&lt;/IfModule&gt;</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>これでNotFoundがなくなりました。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/cakephp-notfound/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: blog.veryposi.info @ 2026-04-05 04:28:18 -->