<?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>Webscriptz.be &#187; MVC</title>
	<atom:link href="http://webscriptz.be/tags/mvc/feed" rel="self" type="application/rss+xml" />
	<link>http://webscriptz.be</link>
	<description></description>
	<lastBuildDate>Sat, 17 Apr 2010 12:45:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>YII framework configuration</title>
		<link>http://webscriptz.be/2009/12/20/yii-framework-configuration/253</link>
		<comments>http://webscriptz.be/2009/12/20/yii-framework-configuration/253#comments</comments>
		<pubDate>Sun, 20 Dec 2009 22:47:49 +0000</pubDate>
		<dc:creator>webscriptz</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[yii]]></category>
		<category><![CDATA[yii framework]]></category>

		<guid isPermaLink="false">http://webscriptz.be/?p=253</guid>
		<description><![CDATA[I&#8217;m toying with the Yii Framework for some time now and even if i cost me a lot of anger and frustration in the beginning I&#8217;m starting to like it more and more, alas I do have to say that the documentation isn&#8217;t always that clear and for someone who begins or who&#8217;ll write some [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m toying with the Yii Framework for some time now and even if i cost me a lot of anger and frustration in the beginning I&#8217;m starting to like it more and more, alas I do have to say that the documentation isn&#8217;t always that clear and for someone who begins or who&#8217;ll write some large applications the configuration file can be a hassle so here&#8217;s my solution:</p>
<blockquote><p>Brake down the configuration file in multiple files, this will give you some speed disadvantage and some will  saying that I&#8217;m raping Yii framework purpose for speed but at least to me it seems more clear</p></blockquote>
<p>This is the protected.config/main.php</p>
<pre class="brush:[php]">
dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=&gt;'WEBSITENAME',
'modules'=&gt;array(
'users'=&gt;array(
//sub modules in the module users
'modules'=&gt;array(
'messaging',
'profile',
'dashboard',
)
),
'about',
'forums',
),
// preloading 'log' component active loading
'preload'=&gt;array('log'),

// autoloading model and component classes lazy loading
// I make the difference between CformModel and CActiveRecord
'import'=&gt;array(
'application.models.*',
'application.models.forms.*',
'application.models.database.*',
),

// application components
'components'=&gt;array(
// enable cookie-based authentication
'user'=&gt;array('allowAutoLogin'=&gt;true),

// data relinquished to database.php
// for easy access and usability as also for the future
// installation procedure, it's less to write to a file
'db'=&gt;include(dirname(__FILE__).'/database.php'),

// for a better overview we exculded url routes to a seperate file
'urlManager'=&gt;include(dirname(__FILE__).'/routes.php'),

//authentication component needs data from db for CdbConnection
'authManager'=&gt;array(
'class'=&gt;'CDbAuthManager',
'connectionID'=&gt;'db',
'defaultRoles'=&gt;array('authenticated', 'guest'),
),

//security measures
'request'=&gt;array(
'enableCsrfValidation'=&gt;true,
'enableCookieValidation'=&gt;true,
),
),

// application-level parameters that can be accessed
// using Yii::app()-&gt;params['paramName']
// uncomment the following if you want static params in the application
//'params'=&gt;array(include(dirname(__FILE__).'/params.php'))
);</pre>
<p>database.php</p>
<pre class="brush:[php]">
'CDbConnection',
'connectionString'=&gt;'mysql:host=localhost;dbname=mysql',
//'connectionString'=&gt;'pgsql:host=localhost;port=5432;dbname=mysql',
'username' =&gt; 'root',
'password' =&gt; '',
);
?&gt;
</pre>
<p>routes.php</p>
<pre class="brush:[php]">
'path', // path or get
'urlSuffix' =&gt; '', //.html .whateverextentionyouwant
'showScriptName' =&gt; true,
'rules'=&gt;array(
'users/recovery/perimeterSecurity/'=&gt;'users/recovery/perimeterSecurity',
),
);
?&gt;
</pre>
<p>param.php</p>
<pre class="brush:[php]">//nothing in it at the moment</pre>
]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2009/12/20/yii-framework-configuration/253/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CodeIgniter the views and .htaccess</title>
		<link>http://webscriptz.be/2009/03/14/codeigniter-and-views-and-htaccess/219</link>
		<comments>http://webscriptz.be/2009/03/14/codeigniter-and-views-and-htaccess/219#comments</comments>
		<pubDate>Sat, 14 Mar 2009 20:23:53 +0000</pubDate>
		<dc:creator>webscriptz</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[Ci]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[views]]></category>

		<guid isPermaLink="false">http://webscriptz.be/?p=219</guid>
		<description><![CDATA[I must admit that I not a huge fan of Frameworks and Patterns because: A) They make things complicated B) Subject you to some nasty code stuff and rules C) Because templating and Frameworks can be water and fire. Codeigniter on the opposite has some advantage on it side for the templating stuff. This is [...]]]></description>
			<content:encoded><![CDATA[<p>I must admit that I not a huge fan of Frameworks and Patterns because:</p>
<blockquote><p>A) They make things complicated</p>
<p>B) Subject you to some nasty code stuff and rules</p>
<p>C) Because templating and Frameworks can be water and fire.</p></blockquote>
<p>Codeigniter on the opposite has some advantage on it side for the templating stuff. This is really a short explanation for a common problem in other framework.</p>
<p>What to do if you want a nice folder structure or have different template styles, remember this is just a basic thing which happen to work in CI 1.7.</p>
<p><code><br />
function index(){<br />
$this-&gt;load-&gt;view('Themename/news/index);<br />
}</code></p>
<p>Just add some slashes an it works so normally it should work if you would make an adaptation for themes too with a variable in it.</p>
<p>The next thing was kind of hard to find on the web so let me share it. It&#8217;s for when you develop with CI and your not working in the root directory of your server.</p>
<p><code><br />
DirectoryIndex index.php<br />
RewriteEngine on<br />
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] </code></p>
]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2009/03/14/codeigniter-and-views-and-htaccess/219/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVC again</title>
		<link>http://webscriptz.be/2009/03/09/mvc-again/214</link>
		<comments>http://webscriptz.be/2009/03/09/mvc-again/214#comments</comments>
		<pubDate>Mon, 09 Mar 2009 21:49:06 +0000</pubDate>
		<dc:creator>webscriptz</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[exp]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://webscriptz.be/?p=214</guid>
		<description><![CDATA[I&#8217;ve grew bored of having to deal with some irritating PHP issues so I&#8217;ve turned my back to those and began testing codeIgniter. It seems strait forward but templating already has me intrigued with problems and mod_rewrite needs a look too I think :p .]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve grew bored of having to deal with some irritating PHP issues so I&#8217;ve turned my back to those and began testing codeIgniter. It seems strait forward but templating already has me intrigued with problems and mod_rewrite needs a look too I think :p .</p>
]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2009/03/09/mvc-again/214/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cakephp</title>
		<link>http://webscriptz.be/2008/11/01/cakephp/142</link>
		<comments>http://webscriptz.be/2008/11/01/cakephp/142#comments</comments>
		<pubDate>Fri, 31 Oct 2008 22:40:15 +0000</pubDate>
		<dc:creator>webscriptz</dc:creator>
				<category><![CDATA[me]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://webscriptz.be/?p=142</guid>
		<description><![CDATA[Begin this week I began to experiment with cakephp but there&#8217;s a downside, Cake is something like rails but unfortunately the framework has less good tutorials.]]></description>
			<content:encoded><![CDATA[<p>Begin this week I began to experiment with cakephp but there&#8217;s a downside, Cake is something like rails but unfortunately the framework has less good tutorials.</p>
]]></content:encoded>
			<wfw:commentRss>http://webscriptz.be/2008/11/01/cakephp/142/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
