<?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>STUDIO KINGDOM &#187; CakePHP修行</title>
	<atom:link href="http://www.studio-kingdom.com/category/cakephp/cakephp_training/feed" rel="self" type="application/rss+xml" />
	<link>http://www.studio-kingdom.com</link>
	<description>PHPによるWebプログラミングやAdobeソフトによるWEBデザインなどなど</description>
	<lastBuildDate>Tue, 31 Mar 2009 15:37:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>アプリひとまず完成（CakePHP修行 #14）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/184</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/184#comments</comments>
		<pubDate>Mon, 27 Oct 2008 13:12:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/?p=184</guid>
		<description><![CDATA[				完成といってもまだまだ機能不足で課題も多いですが・・・。
				http://clubss.studio-kingdom.com/
				(メール：guest@studio-kingdom.com、パスワード [...]]]></description>
			<content:encoded><![CDATA[				<p>完成といってもまだまだ機能不足で課題も多いですが・・・。</p>
				<p><a href="http://clubss.studio-kingdom.com/" target="_blank">http://clubss.studio-kingdom.com/<br />
				</a>(メール：guest@studio-kingdom.com、パスワード：guest でログインすることができます。)</p>
				<p>改めてこのWEBアプリの趣旨を確認し、今後実装したい機能を挙げてみました。</p>
				<h3>WEBアプリの趣旨</h3>
				<p>友達やサークルなどの仲間内で利用してもらう。<br />
				このアプリを利用することで、イベントを<span style="color: #ff0000;">「気軽」</span>に企画することが出来るようになるのが狙い。モンスターハンターなどのネットワークゲームでも利用されることを期待している。</p>
				<h3>今後実装したい機能</h3>
				<p>・携帯電話対応<br />
				・グループ機能<br />
				・アンケート機能</p>
				<p>下記の画像は実際にWebサーバで動いているものをキャプチャーしたものです。<br />
				上から順に「トップ、カレンダー、飲み会等のイベント参加、メンバー一覧、設定」となっています。</p>
				<p><a href="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubsstop11.png"><img style="display: inline" title="clubss-top" src="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubsstop11-thumb.png" alt="clubss-top" width="128" height="104" /></a></p>
				<p><a href="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubsscal.png"><img style="display: inline" title="clubss-cal" src="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubsscal-thumb.png" alt="clubss-cal" width="128" height="104" /></a></p>
				<p><a href="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubssevent.png"><img style="display: inline" title="clubss-event" src="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubssevent-thumb.png" alt="clubss-event" width="128" height="104" /></a></p>
				<p><a href="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubssmem4.png"><img style="display: inline" title="clubss-mem" src="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubssmem4-thumb.png" alt="clubss-mem" width="128" height="75" /></a></p>
				<p><a href="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubssset1.png"><img style="display: inline" title="clubss-set" src="http://www.studio-kingdom.com/wp-content/uploads/2008/11/clubssset1-thumb.png" alt="clubss-set" width="128" height="81" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/184/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>開発中アプリの大まかなイメージを作成（CakePHP修行 #13）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/81</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/81#comments</comments>
		<pubDate>Thu, 18 Sep 2008 12:15:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/cakephp_training/136</guid>
		<description><![CDATA[				Fireworks使って　↓　のようにデザインしてみました。
				次はHTMLとCSSに取り掛かって、要件ももっと詰めていかないと。
				
				
				
]]></description>
			<content:encoded><![CDATA[				<p>Fireworks使って　↓　のようにデザインしてみました。<br />
				次はHTMLとCSSに取り掛かって、要件ももっと詰めていかないと。</p>
				<p><a href="http://www.studio-kingdom.com/wp-content/uploads/2008/04/clbs_top.png" title="clbs_top.png"><img src="http://www.studio-kingdom.com/wp-content/uploads/2008/04/clbs_top.thumbnail.png" alt="clbs_top.png" /></a></p>
				<p><a href="http://www.studio-kingdom.com/wp-content/uploads/2008/04/clbs_cal.png" title="clbs_cal.png"><img src="http://www.studio-kingdom.com/wp-content/uploads/2008/04/clbs_cal.thumbnail.png" alt="clbs_cal.png" /></a></p>
				<p><a href="http://www.studio-kingdom.com/wp-content/uploads/2008/04/clbs_ref.png" title="clbs_ref.png"><img src="http://www.studio-kingdom.com/wp-content/uploads/2008/04/clbs_ref.thumbnail.png" alt="clbs_ref.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/81/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>開発の心得（CakePHP修行 #12）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/80</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/80#comments</comments>
		<pubDate>Tue, 16 Sep 2008 17:12:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/cakephp_training/135</guid>
		<description><![CDATA[				こちらのエントリーを参考に開発の心得というやつを作ってみた。
				新サービスを開発するときに気をつけてること
				 1.コンセプト = メタファーを決める
				「飲み会企画クラブ」みたいな感じかなぁ。 [...]]]></description>
			<content:encoded><![CDATA[				<p>こちらのエントリーを参考に開発の心得というやつを作ってみた。<br />
				<a href="http://blog.myrss.jp/archives/2008/02/post_130.html" target="_blank">新サービスを開発するときに気をつけてること</a></p>
				<blockquote><p> 1.コンセプト = メタファーを決める</p></blockquote>
				<p>「飲み会企画クラブ」みたいな感じかなぁ。<br />
				飲み会以外にも、クラブ・サークル活動なんかのイベントも含む。</p>
				<p>登録ユーザーがTwitter風な発言コーナーで<br />
				A:「たまには飲みにいかない？」<br />
				B:「いいねー、企画して！」<br />
				A:「じゃ、週末に。」<br />
				A:「飲み会登録しました。参加する人は参加登録しといて。」<br />
				C:「参戦します。参加登録しときました。」<br />
				のような流れで使われることを期待しています。<br />
				ちなみにネットサービスではなく、CMSチックなものを目指しています。<br />
				「CakePHPセットアップしてから、このソース突っ込んでください」みたいな。</p>
				<blockquote><p>2.サービス名を決める</p></blockquote>
				<p>Club + Class で Clubssとしてるけど、何かイマイチ・・・。</p>
				<blockquote><p>3.アイデア ⇒ 開発 ⇒ 仕上げ の苦しみ度合いを理解しておく</p></blockquote>
				<p>理解してないですね。<br />
				萎えないような工夫として、やはり人を巻き込むことでしょうか。<br />
				CakePHPのフォーラムに「こんなもの作ってます！」と宣言してみるか。</p>
				<blockquote><p> 4.時間をかけて悩んだものはアウト</p></blockquote>
				<p>本当にその通りだと思います。<br />
				これまでの経験から、何度か煮詰まったら一旦全部まっさらにして最初からやり直した方が早いことが多いです。</p>
				<blockquote><p>5.デザインから入る</p></blockquote>
				<p>教えに従うことにしました。FireWorksで作成中。</p>
				<blockquote><p>6.デザインを懲りすぎない</p></blockquote>
				<p>これも同意。<br />
				良質なアイコン素材と背景のグラデーションでごまかして乗り切る予定。</p>
				<blockquote><p>7.デザインのポイントは余白</p></blockquote>
				<p>「プロのデザイナーは余白をデザインする」という話を聞いたことがあります。<br />
				逆に素人は余白を埋めたがるそうな。</p>
				<blockquote><p>8.LEGO ブロックみたいなパーツから作り始める</p></blockquote>
				<p>もう少し詳しく知りたい！<br />
				汎用的なクラスや関数のこと？<br />
				ヘッダーやフッター、メニューなんかの共通パーツのこと？<br />
				それとも、全部のことかな。</p>
				<blockquote><p> 9.LEGO ブロックを一気に組み立てる</p></blockquote>
				<p>この作業は楽しそうですね。モチベーションが無いとなぁ。</p>
				<blockquote><p>10.仕上げはリリース日の設定から</p></blockquote>
				<p>完全プライベートでやっているので、仕事との兼ね合いがあって決めるのが非常に難しい。<br />
				10月いっぱいの完成を目指して進めたいところ。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/80/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>途中経過（CakePHP修行 #11）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/78</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/78#comments</comments>
		<pubDate>Mon, 08 Sep 2008 13:09:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/cakephp_training/129</guid>
		<description><![CDATA[				久々の更新です。ネタがありませんが・・・。
				
				継続するって難しい…。
				1週間に2,3つのクオリティの高いエントリーを投稿し続けるαブロガーってやっぱ凄いですね。
]]></description>
			<content:encoded><![CDATA[				<p>久々の更新です。ネタがありませんが・・・。</p>
				<p><img src="http://www.studio-kingdom.com/wp-content/uploads/2008/04/2008-04-08_214531.png" alt="2008-04-08_214531.png" /></p>
				<p>継続するって難しい…。<br />
				1週間に2,3つのクオリティの高いエントリーを投稿し続けるαブロガーってやっぱ凄いですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/78/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB日付値を任意のフォーマットで取得するコンポーネント（CakePHP修行 #10）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/77</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/77#comments</comments>
		<pubDate>Wed, 13 Aug 2008 12:30:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/cakephp_training/127</guid>
		<description><![CDATA[				カレンダー・スケジュールに関するアプリを作っている関係上、どうしても日付に関する処理が多くなってしまいます。
				DBに保存した日付値を任意のフォーマットに変換してくれるコンポーネントやヘルパーがデフォルトで [...]]]></description>
			<content:encoded><![CDATA[				<p>カレンダー・スケジュールに関するアプリを作っている関係上、どうしても日付に関する処理が多くなってしまいます。<br />
				DBに保存した日付値を任意のフォーマットに変換してくれるコンポーネントやヘルパーがデフォルトで用意されていないか探してみたのですが見つからない…。<br />
				多分、Timeヘルパーあたりにあると思うのですが、ヘルパーだとController内で使用することが出来ないので「DatetimeComponent」なるコンポーネントを自作してみました。</p>
				<p>componentsフォルダにdatetime.phpファイルを作成し、下記のソースをコピペ。</p>
				<p><strong>・app/controllers/components/datetime.php</strong></p>
				<pre class="brush: php;">
&lt;?php
class DatetimeComponent extends Object
{
	var $controller = null;

	function __construct(){
		parent::__construct();
	}

	function startup(&amp;amp;amp;$controller){
		$this-&gt;controller =&amp;amp;amp; $controller;
	}

	function toFormat($elem, $format){
		//2008-02-27 00:00:00
		$set_year = substr($elem, 0, 4);    //年
		$set_month = substr($elem, 5, 2);    //月
		$set_day = substr($elem, 8, 2);        //日
		$set_hour = substr($elem, 11, 2);    //時
		$set_minute = substr($elem, 14, 2);    //分
		$set_second = substr($elem, 17, 2);    //秒

		return date($format, mktime($set_hour, $set_minute, $set_second, $set_month, $set_day, $set_year));
	}
}
?&gt;
</pre>
				<p>フォーマットの指定はPHPの標準関数であるDate関数と同じ形式です。<br />
				↓こんな感じで使用します。</p>
				<pre class="brush: php;">
$yyyy_m_d = $this-&gt;Datetime-&gt;toFormat($this-&gt;data['Schedule']['start'],'Y/n/j');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/77/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>登録したスケジュールをカレンダーに表示（CakePHP修行 #9）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/76</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/76#comments</comments>
		<pubDate>Sun, 27 Jul 2008 11:19:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/cakephp_training/126</guid>
		<description><![CDATA[				今回はカレンダーページ上に、登録したスケジュールのタイトルを表示する処理を実装します。
				コントローラーのCalendarアクションを変更します。
				・app/controllers/schedule [...]]]></description>
			<content:encoded><![CDATA[				<p>今回はカレンダーページ上に、登録したスケジュールのタイトルを表示する処理を実装します。</p>
				<p>コントローラーのCalendarアクションを変更します。<br />
				<strong>・app/controllers/schedules_controller.php</strong></p>
				<pre class="brush: php;">
//calendar
function calendar($year = null, $month = null){
	//システムメッセージをセット
	$this-&gt;set('sys_msg', $this-&gt;Session-&gt;read('sys_msg'));
	$this-&gt;Session-&gt;delete('sys_msg');

	//指定された年月を取得／指定なしの場合はシステム日付を取得
	if($year == null || $month == null){
		$Month = new Calendar_Month_Weekdays( date('Y'), date('m'), 0 );
		$year = date('Y');
		$month = date('m');
	} else {
		$Month = new Calendar_Month_Weekdays( $year, $month, 0 );
	}
	//PEARよりカレンダー情報を読み込み
	$Month-&gt;build();
	$this-&gt;set('month', $Month);
	//取得した年月、次月、前月をYYYY/MM形式で変数にセット
	$this-&gt;set('next_year_month', date(&quot;Y/m&quot;, mktime(0, 0, 0, $month+1, 1, $year)));
	$this-&gt;set('this_year_month', date(&quot;Y/m&quot;, mktime(0, 0, 0, $month, 1, $year)));
	$this-&gt;set('prev_year_month', date(&quot;Y/m&quot;, mktime(0, 0, 0, $month-1, 1, $year)));

	//取得した年月のスケジュール情報をScheduleから取得
	$cond = array(
		'AND' =&gt; array(
		array(&quot;Schedule.start&quot; =&gt; &quot;&gt;=$year-$month-01&quot;)
		,array(&quot;Schedule.start&quot; =&gt; &quot;&lt; =$year-$month-31&quot;)
		)
	);
	$this-&gt;set('schedules', $this-&gt;Schedule-&gt;findAll($cond));
}
</pre>
				<p><span id="more-76"></span></p>
				<p>ビューのCalendarページの日付セルにスケジュールタイトルを表示するように処理を付け加えます。<br />
				<strong>・app/views/schedules/calendar.thtml</strong></p>
				<pre class="brush: php;">
&lt;h1&gt;Calendar&lt;/h1&gt;
&lt; ?php
echo $html-&gt;link('&lt; &lt;', '/schedules/calendar/' . $prev_year_month);
echo $this_year_month;
echo $html-&gt;link('&gt;&gt;', '/schedules/calendar/' . $next_year_month);
?&gt;

&lt;!-- ▼sys_msg --&gt;
&lt; ?php if(isset($sys_msg)){ ?&gt;
&lt;div id=&quot;sys_msg&quot;&gt;&lt; ?php echo($sys_msg); ?&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
$(document).ready(function() { $(&quot;#sys_msg&quot;).fadeOut(2500); });
// --&gt;&lt;/script&gt;
&lt; ?php } ?&gt;
&lt;!-- ▲sys_msg --&gt;

&lt;!-- ▼calendar --&gt;
&lt;div id=&quot;calendar&quot;&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sun&lt;/th&gt;
&lt;th&gt;Mon&lt;/th&gt;
&lt;th&gt;Tue&lt;/th&gt;
&lt;th&gt;Wed&lt;/th&gt;
&lt;th&gt;Thu&lt;/th&gt;
&lt;th&gt;Fri&lt;/th&gt;
&lt;th&gt;Sat&lt;/th&gt;
&lt;/tr&gt;
&lt; ?php
while ($Day = $month-&gt;fetch()) {
if ($Day-&gt;isFirst()) {
echo &quot;
&lt;tr&gt;\n&quot;;
}
if ($Day-&gt;isEmpty()) {
echo &quot;
&lt;td&gt;&lt;/td&gt;
\n&quot;;
} else {
echo &quot;
&lt;td&gt;&quot; . $Day-&gt;thisDay();
//add link
echo $html-&gt;link($html-&gt;image(&quot;pencil_add.png&quot; , array(&quot;class&quot;=&gt;&quot;alphafilter&quot;)), '/schedules/add/' . $month-&gt;year . &quot;/&quot; . $month-&gt;month . &quot;/&quot; . $Day-&gt;thisDay(),null,null,false);
echo &quot;\n&quot;;
//schedulesテーブルに登録されているタイトルを表示
echo &quot;
&lt;ul&gt;\n&quot;;
foreach ($schedules as $schedule):
if(date(&quot;Ymd&quot;, strtotime($schedule['Schedule']['start'])) == date(&quot;Ymd&quot;, mktime(0, 0, 0, $month-&gt;month, $Day-&gt;thisDay(), $month-&gt;year))){
echo &quot;
	&lt;li&gt;&quot;;
echo $html-&gt;link($schedule['Schedule']['title'], '/schedules/edit/'.$schedule['Schedule']['id']);
echo &quot;&lt;/li&gt;
\n&quot;;
}
endforeach;
echo &quot;&lt;/ul&gt;
\n&quot;;
echo &quot;&lt;/td&gt;
\n&quot;;
}
if ($Day-&gt;isLast()) {
echo &quot;&lt;/tr&gt;
\n&quot;;
}
}
?&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;!-- ▲calendar --&gt;
</pre>
				<p>カレンダー上に表示するタイトルのスタイルを指定<br />
				<strong>・app/webroot/css/cake.generic.css</strong></p>
				<pre class="brush: css;">
#calendar ul{
	margin: 0;
	padding: 0;
	list-style-image:none;
	list-style-position:outside;
	list-style-type:none;
}

#calendar li{
	margin:0;
	padding:3px 0px 1px 18px;
	background-image:url(/img/arr.png);
	background-repeat:no-repeat;
	line-height:120%;
	margin-bottom:0px;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/76/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>スケジュール登録処理を作成（CakePHP修行 #8）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/74</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/74#comments</comments>
		<pubDate>Fri, 18 Jul 2008 13:08:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/cakephp_training/122</guid>
		<description><![CDATA[				今回はスケジュール登録画面を作成します。
				今回は(1)スケジュール登録ページのリンク→(2)登録ページ→(3)登録処理→(4)登録完了メッセージの表示、と
				順を追って説明していきます。
				ち [...]]]></description>
			<content:encoded><![CDATA[				<p>今回はスケジュール登録画面を作成します。<br />
				今回は(1)スケジュール登録ページのリンク→(2)登録ページ→(3)登録処理→(4)登録完了メッセージの表示、と<br />
				順を追って説明していきます。</p>
				<p>ちなみに完成画像はこちら↓</p>
				<p><a href='http://www.studio-kingdom.com/wp-content/uploads/2008/02/calendar_add.gif' title='calendar_add.gif'><img src='http://www.studio-kingdom.com/wp-content/uploads/2008/02/calendar_add.thumbnail.gif' alt='calendar_add.gif' /></a></p>
				<p><a href='http://www.studio-kingdom.com/wp-content/uploads/2008/02/schedule_add.gif' title='schedule_add.gif'><img src='http://www.studio-kingdom.com/wp-content/uploads/2008/02/schedule_add.thumbnail.gif' alt='schedule_add.gif' /></a></p>
				<p><strong>(1)スケジュール登録ページのリンク</strong><br />
				<b>・app/view/schelue/calendar.thtml</b><br />
				※前回まで、app/view/schelue/index.thtmlだったファイルをcalendar.thtmlに変更しました。</p>
				<p>まずは、カレンダーページの日付セル内にそれぞれ日付登録ページへのリンクを張ります。<br />
				ここでリンク画像に<a href="http://www.famfamfam.com/lab/icons/" target="_blank">famfamfam</a>さんの画像を使用します。<br />
				画像形式がPNGなので、IE6対策を施しておきます。<br />
				IE6のPNG画像透過処理を行ってくれる<a href="http://blog.webcreativepark.net/2007/02/01-233315.html" target="_blank">to-Rさんが作成された便利なjsライブラリ</a>があるので、<br />
				それを利用させていただきます。ダウンロードしたjsファイルをapp/webroot/jsフォルダに入れてください。</p>
				<p>リンクをこんな風に記述。</p>
				<pre class="brush: php;">
echo $html-&gt;link($html-&gt;image(&quot;pencil_add.png&quot; , array(&quot;class&quot;=&gt;&quot;alphafilter&quot;)), '/schedules/add/' . $month-&gt;year . &quot;/&quot; . $month-&gt;month . &quot;/&quot; . $Day-&gt;thisDay(),null,null,false);
</pre>
				<p>また、ダウンロードしたjsファイルを読み込むために、レイアウトのデフォルトファイルにjsファイル読み込みの記述を追加します。<br />
				後述するjqueryファイルも同じように追記します。<br />
				<b>・app/views/layouts/default.thtml</b></p>
				<pre class="brush: php;">
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
&lt;title&gt;&lt; ?php echo $title_for_layout ?&gt;&lt;/title&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;/css/cake.generic.css&quot; type=&quot;text/css&quot;&gt;

&lt;script type=&quot;text/javascript&quot; src=&quot;/js/alphafilter.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/js/jquery.js&quot;&gt;&lt;/script&gt;
&lt;/link&gt;&lt;/head&gt;
</pre>
				<p><span id="more-74"></span></p>
				<p><strong>(2)登録ページ</strong><br />
				<b>・app/view/schedule/add.thtml</b></p>
				<p>app/view/schedlue配下にadd.thtmlを作成します。<br />
				このファイルはCakePHPの典型的な、登録フォームのページにします。</p>
				<pre class="brush: php;">
&lt;h1&gt; - Schedule Add - &lt;/h1&gt;

&lt;div id=&quot;content&quot;&gt;
&lt;h2&gt;&lt; ?php echo($year . &quot;/&quot; . $month . &quot;/&quot; . $day) ?&gt;&lt;/h2&gt;
&lt; ?php echo($html-&gt;link(&quot;Back&quot;, '/schedules/calendar/' . $year .'/' . $month)) ?&gt;

&lt;form method=&quot;post&quot; action=&quot;&lt;?php echo $html-&gt;url('/schedules/add/' . $year . &quot;/&quot; . $month)?&gt;&quot;&gt;
    &lt; ?php echo $html-&gt;hidden('Schedule/start_year', array(&quot;value&quot; =&gt; $year)) ?&gt;
    &lt; ?php echo $html-&gt;hidden('Schedule/start_month', array(&quot;value&quot; =&gt; $month)) ?&gt;
    &lt; ?php echo $html-&gt;hidden('Schedule/start_day', array(&quot;value&quot; =&gt; $day)) ?&gt;
    &lt;p&gt;
        Title：
        &lt; ?php echo $html-&gt;input('Schedule/title', array('size' =&gt; '40'))?&gt;
        &lt; ?php echo $html-&gt;tagErrorMsg('Schedule/title', 'タイトルは必ず入力してください。') ?&gt;
    &lt;/p&gt;
    &lt;p&gt;
        Content：
        &lt; ?php echo $html-&gt;textarea('Schedule/content', array('rows'=&gt;'10')) ?&gt;
        &lt; ?php echo $html-&gt;tagErrorMsg('Schedule/content', '本文は必ず入力してください。') ?&gt;
    &lt;/p&gt;
    &lt;p&gt;
        &lt; ?php echo $html-&gt;submit('Save') ?&gt;
    &lt;/p&gt;
&lt;/form&gt;
&lt;/div&gt;
</pre>
				<p><strong>(3)登録処理</strong><br />
				<b>・app/controllers/schedules_controller.php</b></p>
				<p>登録処理もCakePHPの典型的な登録処理です。<br />
				登録完了メッセージをセッションに入れているのは<a href="http://www.ideaxidea.com/archives/cakephp/" target="_blank">百式さんの手法</a>をパクらせていただきました。</p>
				<pre class="brush: php;">
//add
function add($year = null, $month = null, $day = null)
{
	$this-&gt;set(&quot;year&quot;,$year);
	$this-&gt;set(&quot;month&quot;,$month);
	$this-&gt;set(&quot;day&quot;,$day);

	if(!empty($this-&gt;data))
	{
		//日付をセット
		$this-&gt;data['Schedule']['start'] =
			$this-&gt;data['Schedule']['start_year'] . &quot;-&quot; .
			$this-&gt;data['Schedule']['start_month'] . &quot;-&quot; .
			$this-&gt;data['Schedule']['start_day'];

		//データ保存
		if($this-&gt;Schedule-&gt;save($this-&gt;data))
		{
			$this-&gt;Session-&gt;write('sys_msg', 'Your schedule has been saved.');
			$this-&gt;redirect('/schedules/calendar/' . $year . &quot;/&quot; . $month);
		}
	}
}
</pre>
				<p><strong>(4)登録完了メッセージの表示</strong><br />
				<b>・app/view/schelue/calendar.thtml</b></p>
				<p>登録完了メッセージをjqeryを使用して、ふわーんと表示させています。これも<a href="http://www.ideaxidea.com/archives/cakephp/" target="_blank">百式さんの手法</a>をパクらせていただきました。</p>
				<pre class="brush: php;">
&lt;!-- ▼sys_msg --&gt;
&lt; ?php if(isset($sys_msg)){ ?&gt;
&lt;div id=&quot;sys_msg&quot;&gt;&lt; ?php echo($sys_msg); ?&gt;&lt;/div&gt;
&lt;script&gt;
$(document).ready(function() { $(&quot;#sys_msg&quot;).fadeOut(2500); });
&lt;/script&gt;
&lt; ?php } ?&gt;
&lt;!-- ▲sys_msg --&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/74/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>テーブルレイアウトを調整（CakePHP修行 #7）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/73</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/73#comments</comments>
		<pubDate>Mon, 07 Jul 2008 11:53:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/cakephp_training/120</guid>
		<description><![CDATA[				たいしたネタではないですが、テーブルのレイアウトを変更したのでソースを載せておきます。CakePHPと関係ないな…。
				レイアウト変更後は↓のようになります。
				
				・app/webroot/c [...]]]></description>
			<content:encoded><![CDATA[				<p>たいしたネタではないですが、テーブルのレイアウトを変更したのでソースを載せておきます。CakePHPと関係ないな…。<br />
				レイアウト変更後は↓のようになります。</p>
				<p><a href='http://www.studio-kingdom.com/wp-content/uploads/2008/02/table_layouts.gif' title='table_layouts.gif'><img src='http://www.studio-kingdom.com/wp-content/uploads/2008/02/table_layouts.thumbnail.gif' alt='table_layouts.gif' /></a></p>
				<p><b>・app/webroot/css/cake.generic.css</b>に追加</p>
				<pre class="brush: css;">
/* table */
table {
	font-size:12px;
	color:#333333;
	background-color:#FFFFFF;
	clear:both;
	padding:0;
	margin:0 auto;
	white-space: normal;
	border-collapse:collapse;
}
th {
	background-color: #EEEEEE;
	border: 1px solid #CCCCCC;
	text-align: center;
	padding:4px 4px;
	border-collapse:collapse;
}
table tr td {
	border: 1px dotted #CCCCCC;
	padding:4px 4px;
	vertical-align:top;
	text-align: left;
	border-collapse:collapse;
}

/* calendar */
.holiday{
	font-size:10px;
	color:#666666;
}

#calendar {width:700px;}

#calendar ul{
	margin: 5px 0;
	padding: 0;
	list-style-image:none;
	list-style-position:outside;
	list-style-type:none;
}

#calendar li{
	background-image:url(/img/arr.png);
	background-repeat:no-repeat;
	line-height:120%;
	margin-bottom:0px;
	padding:3px 0px 1px 18px;
}

#calendar table tr td {
	height:80px;
	width:100px
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/73/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>カレンダーページを作成（CakePHP修行 #6）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/72</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/72#comments</comments>
		<pubDate>Sat, 05 Jul 2008 12:55:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/cakephp_training/117</guid>
		<description><![CDATA[				今回はPearを使ってカレンダー表示ページを作成します。Pearとカレンダーパッケージについては以前にも参考にさせていただいたことのあるmukoさんのブログエントリーが分かりやすいです。コメントも含めて参考にさせ [...]]]></description>
			<content:encoded><![CDATA[				<p>今回はPearを使ってカレンダー表示ページを作成します。Pearとカレンダーパッケージについては以前にも参考にさせていただいたことのあるmukoさんのブログエントリーが分かりやすいです。コメントも含めて参考にさせていただきました。</p>
				<p><a href="http://creative-interactive.lumber-mill.com/blog/webprograming/2007/08/15/14" target="_blank"><span class="nodeLabelBox repTarget"></span><span class="nodeText editable">creative@interactive ≫ CakePHPとカレンダー表示（2）</span> </a></p>
				<p>まずは下記のようにvendorフォルダにPEARとカレンダーパッケージを配置します。</p>
				<p><img src="http://www.studio-kingdom.com/wp-content/uploads/2008/02/vendor_pear.gif" alt="vendor_pear.gif" /></p>
				<p><span id="more-72"></span></p>
				<p><b>・app/vendors/pear_ini.php</b></p>
				<pre class="brush: php;">
define('PEAR_PATH', dirname(__FILE__) . DS . 'PEAR');
ini_set('include_path', PEAR_PATH . PATH_SEPARATOR . ini_get('include_path'));
</pre>
				<p><b>・app/controllers/schedules_controller.php</p>
				<pre class="brush: php;">
vendor(&quot;pear_ini&quot;);
vendor(&quot;PEAR/Calendar/Month/Weekdays&quot;);

class SchedulesController extends AppController
{
	var $name = 'Schedules';
	var $uses = array('Schedule');

	function index($year = null, $month = null)
	{
		//スケジュール読み込み
		$this-&gt;set('schedules', $this-&gt;Schedule-&gt;findAll());
		if($year == null || $month == null)
		{
			$Month = new Calendar_Month_Weekdays( date('Y'), date('m'), 0 );
			$year = date('Y');
			$month = date('m');
		} else {
			$Month = new Calendar_Month_Weekdays( $year, $month, 0 );
		}
		//PEARよりカレンダー情報を読み込み
		$Month-&gt;build();
		$this-&gt;set('month', $Month);
	}
}
</pre>
				<p></b><b>・app/views/schedules/index.thtml</b></p>
				<pre class="brush: php;">
&lt;h1&gt; - Test - &lt;/h1&gt;

&lt;!-- ▼calendar --&gt;
&lt;div id=&quot;calendar&quot;&gt;
&lt;table border=&quot;0&quot;&gt;
  &lt;tr&gt;
    &lt;th&gt;Sun&lt;/th&gt;
    &lt;th&gt;Mon&lt;/th&gt;
    &lt;th&gt;Tue&lt;/th&gt;
    &lt;th&gt;Wed&lt;/th&gt;
    &lt;th&gt;Thu&lt;/th&gt;
    &lt;th&gt;Fri&lt;/th&gt;
    &lt;th&gt;Sat&lt;/th&gt;
  &lt;/tr&gt;
&lt; ?php
    while ($Day = $month-&gt;fetch()) {
        if ($Day-&gt;isFirst()) {
            echo &quot;&lt;tr&gt;\n&quot;;
        }
        if ($Day-&gt;isEmpty()) {
            echo &quot;&lt;td&gt;&amp;amp;nbsp;&lt;/td&gt;\n&quot;;
        } else {
            echo &quot;&lt;td&gt;&quot; . $Day-&gt;thisDay() . &quot;&lt;/td&gt;\n&quot;;
        }
        if ($Day-&gt;isLast()) {
            echo &quot;&lt;/tr&gt;\n&quot;;
        }
    }
?&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;!-- ▲calendar --&gt;
</pre>
				<p>ここまでやれば下記のような感じでカレンダーページが表示されると思います。<br />
				<a href='http://www.studio-kingdom.com/wp-content/uploads/2008/02/clbs_cal_page.gif' title='clbs_cal_page.gif'><img src='http://www.studio-kingdom.com/wp-content/uploads/2008/02/clbs_cal_page.thumbnail.gif' alt='clbs_cal_page.gif' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/72/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>デフォルトレイアウトとCSSの変更（CakePHP修行 #5）</title>
		<link>http://www.studio-kingdom.com/cakephp/cakephp_training/71</link>
		<comments>http://www.studio-kingdom.com/cakephp/cakephp_training/71#comments</comments>
		<pubDate>Tue, 01 Jul 2008 12:16:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP修行]]></category>

		<guid isPermaLink="false">http://www.studio-kingdom.com/cakephp_training/115</guid>
		<description><![CDATA[				前回までは主にDB周りの作業でしたが、今回はデザイン周りの作業を進めてみたいと思います。
				CakePHPでは、「app/views/layouts」フォルダ内の「default.thtml」をアプリケーシ [...]]]></description>
			<content:encoded><![CDATA[				<p>前回までは主にDB周りの作業でしたが、今回はデザイン周りの作業を進めてみたいと思います。<br />
				CakePHPでは、「app/views/layouts」フォルダ内の「default.thtml」をアプリケーション全体のデザインテンプレートのように扱うことが出来ます。デザインを変更するということで当然CSSにも手を加えます。<br />
				このCSSレイアウトを構築するに当たってYEAR OF THE CAT STYLEさんの記事が大変参考になりました。</p>
				<p>・<a href="http://desperadoes.biz/style/dan/" target="_blank">スタイルシートによる崩れない　2カラム　3カラム・レイアウト</a></p>
				<p><b>・app/vies/layouts/default.thtml</b><br />
				（ファイルが存在しない場合は、作成してください。）</p>
				<pre class="brush: php;">
&lt; ! DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
&lt;title&gt;&lt; ?php echo $title_for_layout ?&gt;&lt;/title&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;/css/cake.generic.css&quot; type=&quot;text/css&quot;&gt;

&lt;/link&gt;&lt;/head&gt;
&lt;body&gt;

&lt;!-- ▼container --&gt;
&lt;div id=&quot;container&quot;&gt;

&lt;!-- ▼header --&gt;
&lt;div id=&quot;header&quot;&gt;
	&amp;amp;nbsp;
&lt;/div&gt;
&lt;!-- ▲header --&gt;

&lt;!-- ▼contents --&gt;
&lt;div id=&quot;contents&quot;&gt;
&lt; ?php echo $content_for_layout ?&gt;
&lt;/div&gt;
&lt;!-- ▲contents --&gt;

&lt;/div&gt;
&lt;!-- ▲container --&gt;

&lt;!-- ▼footer --&gt;
&lt;div id=&quot;footer&quot;&gt;Copyright &amp;amp;copy; 2008 STUDIO KINGDOM All rights reserved.&lt;/div&gt;
&lt;!-- ▲footer --&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
				<p>次はスタイルシートです。ちょっと長いですが、インデントされている箇所が変更されています。<br />
				<b>・app/webroot/css/cake.generic.css</b></p>
				<pre class="brush: css;">
*{
	margin:0;
	padding:0;
}

body{
	background:transparent url(/img/background.png) repeat scroll 50%;
	color:#000000;
	font-family:Verdana,arial,sans-serif,&quot;ヒラギノ角ゴ Pro W3&quot;,&quot;ＭＳ ゴシック&quot;,&quot;Osaka&quot;;
	font-size:12px;
	margin:0 auto;
	padding:0;
	text-align:center;
	width:100%;
}

/* General Style Info */
a{
	color:#003d4c;
	text-decoration:underline;
}
a:hover{
	color:#003d4c;
	text-decoration:none;
}

a img{
	border:none;
}

h1, h2, h3, h4{
	font-weight:normal;
}

h1{
	color: #003d4c;
	margin:0.3em 0;
	font-size: 180%;
}

h2{
	color:#c6c65b;
	padding-top: 1em;
	margin:0.3em 0;
	font-size: 180%;
}

h3{
	color:#c6c65b;
	padding-top:2em;
	font-size: 140%;
}

h4{
	color:#c6c65b;
	padding-top:0.5em;
	font-weight:normal;
}

em {
	font-size: 12px;
}

ul, li {
	margin: 0 12px;
}

/* Layout */

#container{
	background-color:#FFFFFF;
	margin:0 auto;
	padding:0;
	font-size:12px;
	text-align:left;
	width:700px;
	border-left:#E4E4E4 solid 6px;
	border-right:#E4E4E4 solid 6px;
	border-bottom:#E4E4E4 solid 6px;
}

#header{
	margin:0 0 2px 10px;
}

#content{
	width:700px;
}
#footer{
	clear:both;
	font-size:10px;
	text-align:center;
	color:#666666;
	margin:15px 0;
	padding:0;
}

/* tables */

table {
	width: 100%;
	border-top: 1px solid #ccc;
	border-left: 1px solid #ccc;
	border-bottom: 1px solid #ccc;
	color:#333;
	background-color: #fff;
	clear:both;
	padding: 0;
	margin: 0 0 2em 0;
	white-space: normal;
}
th {
	background-color: #e2e2e2;
	border-top: 1px solid #fff;
	border-left: 1px solid #fff;
	border-right: 1px solid #003d4c;
	border-bottom: 1px solid #003d4c;
	text-align: center;
	padding:1px 4px;
}
table tr td {
	border-right: 1px solid #ddd;
	padding:4px 4px;
	vertical-align:top;
	text-align: center;
}
table tr.altRow td {
	background: #f4f4f4;
}
table td.actions {
	white-space: nowrap;
}
#cakeSqlLog td {
	text-align: left;
	padding: 4px 8px;
	background: #fff;
	border-bottom: 2px solid #ccc;
}

/* scaffold show */

div.related {
	clear:both;
	display:block;
}
dl {
	line-height:2em;
	margin:0em 1em;
	float:left;
	width: 400px;
}
dt {
	font-weight: bold;
	vertical-align:top;
}
dd {
	margin-left:10em;
	margin-top:-2em;
	vertical-align:top;
}

/* notices and errors */

#flashMessage, .error, .error_message {
	color:#900;
	font-size: 16px;
	background-color: #fff;
	margin: 8px 0px;
	font-weight: bold;
}
.error_message {
	clear: both;
}
.error em {
	font-size: 18px;
	color: #003d4c;
}
.notice {
	color: #656565;
	font-size: 14px;
	background-color: #f4f4f4;
	padding: 0.5em;
	margin: 1em 0;
	display:block;
}
.tip {
	color: #656565;
	background-color: #ddd;
}

/* forms */

form {
	margin-top: 2em;
}
form div{
	vertical-align: text-top;
	margin-left: 1em;
	margin-bottom:2em;
}
form div.date{
	margin-left: 0em;
}
label {
	display: block;
	width: 140px;
	font-size: 14px;
	padding-right: 20px;
}
input[type=checkbox] {
	float: left;
	clear: left;
	margin: 2px 6px 7px 2px;
}
input, textarea {
	clear: both;
	display:block;
	font-size: 14px;
	font-family: inherit;
}
select {
	clear: both;
	vertical-align: text-bottom;
	font-size: 14px;
	font-family: inherit;
}
option {
	font-size: 14px;
	font-family: inherit;
	padding: 0 0.3em;
}
input[type=submit] {
	display: inline;
	vertical-align: bottom;
}
div.required {
	clear: both;
	color:#222;
	font-weight:bold;
}
div.optional {
	clear: both;
	color:#555;
}
div.submit {
	clear: both;
	margin-top: 40px;
	margin-left: 140px;
}
/* action links */
ul.actions {
	float: left;
	margin-left:20px;
	width: 200px;
}
ul.actions li {
	margin-top: 4px;
}
pre {
	padding: 1em;
}
</pre>
				<p>コントローラーは$scaffoldを消して下記のように書き換えます。<br />
				<b>・app/controllers/schedules_controller.php</b></p>
				<pre class="brush: php;">
&lt; ?php
class SchedulesController extends AppController
{
	var $name = 'Schedules';

	function index(){
	}
}
?&gt;
</pre>
				<p>schedulesフォルダ、index.thtmlファイルを作成してください。<br />
				<b>・app/views/schedules/index.thtml</b></p>
				<pre class="brush: php;">
&lt;div style=&quot;padding:10px&quot;&gt;
&lt;h1&gt; - Test - &lt;/h1&gt;
&lt;p&gt;
	This is View Test!
&lt;/p&gt;
&lt;/div&gt;
</pre>
				<p>ついでに「routes.php」も書き換えて、schedules/index.thtmlを最初にアクセスするページに設定しておきます。<br />
				コメント行を除く3行のうちの一番上の行を下記のように書き換えてください。</p>
				<p><b>・app/config/routes.php</b></p>
				<pre class="brush: php;">
$Route-&gt;connect ('/', array('controller'=&gt;'schedules', 'action'=&gt;'index'));
</pre>
				<p>ここまで出来たら「http://localhost/」にアクセスしてみます。<br />
				下記のような画面が表示され、デザイン・レイアウトが変更されていることを確認できると思います。</p>
				<p><a href='http://www.studio-kingdom.com/wp-content/uploads/2008/02/cakephp_default_style.gif' title='cakephp_default_style.gif'><img src='http://www.studio-kingdom.com/wp-content/uploads/2008/02/cakephp_default_style.thumbnail.gif' alt='cakephp_default_style.gif' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-kingdom.com/cakephp/cakephp_training/71/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
