<?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/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>WIDGET-INFO &#187; import</title>
	<atom:link href="http://blog.widget-info.net/tag/import/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.widget-info.net</link>
	<description>WIDGET-INFOではCakePHPやIPhone情報、その他開発に関する情報を発信</description>
	<lastBuildDate>Sat, 24 Dec 2011 20:47:30 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.widget-info.net/tag/import/feed/" />
		<item>
		<title>CakePHP　モデルのインポート方法</title>
		<link>http://blog.widget-info.net/2009/09/cakephp_model_import/</link>
		<comments>http://blog.widget-info.net/2009/09/cakephp_model_import/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 15:05:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Controller]]></category>
		<category><![CDATA[Model]]></category>
		<category><![CDATA[import]]></category>

		<guid isPermaLink="false">http://blog.widget-info.net/?p=175</guid>
		<description><![CDATA[CakePHPのモデルでアソシエーションしていないモデル、またはアソシエーションが無い他のモデルを使うこともあるかと思います。]]></description>
			<content:encoded><![CDATA[<p>CakePHPのモデルでアソシエーションしていないモデル、<br />
またはアソシエーションが無い他のモデルを使うこともあるかと思います。</p>
<p>アソシエーションをしていれば問題なく使えますが、アソシエーションをしていないモデルや<br />
アソシエーションが無いモデルは、別の方法でモデルを読み込みます。<br />
例えば最初から利用するのであれば、コントローラー内の</p>
<pre class="brush:php">var $uses=array();</pre>
<p>に記述しますが、特定の段階でとなるとこれでは対応できません。<br />
その場合は特定の段階で<br />
<span id="more-175"></span></p>
<pre class="brush:php">App::import('Model','モデル名');</pre>
<p>と記述後</p>
<pre class="brush:php">$this-&gt;モデル名=new モデル名();</pre>
<p>となります。これで使いたいタイミングでモデルを読み込み、そのモデルを<br />
有効に利用することができます。
<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.widget-info.net%2F2009%2F09%2Fcakephp_model_import%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.widget-info.net/2009/09/cakephp_model_import/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.widget-info.net/2009/09/cakephp_model_import/" />
	</item>
	</channel>
</rss>

