<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3489617876076899900</id><updated>2024-10-06T23:34:04.399-07:00</updated><category term="Getting started"/><category term="Customization"/><title type='text'>Code Yii</title><subtitle type='html'>The ultimate resource and tutorial center for Yii Framework for php.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codeyii.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3489617876076899900/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://codeyii.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>PsyCoder</name><uri>http://www.blogger.com/profile/09909438129542990779</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3489617876076899900.post-5384024503217429977</id><published>2012-04-04T09:06:00.001-07:00</published><updated>2012-04-05T07:23:55.791-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Customization"/><title type='text'>Remove index.php from Yii project URL</title><content type='html'>In this post, we&#39;ll learn how to remove the index.php from the url of a Yii project and thus make the urls more pretty and search engine friendly. Plus, they become more easy to remember. Yayyy!&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2 style=&quot;text-align: left; font-size:16px;&quot;&gt;Step 1 - Create htaccess&lt;/h2&gt;Open notepad or any other text editor, paste the following code into it :&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

RewriteBase /blog

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteCond $1 !^(index\.php)
RewriteRule ^(.+)$ index.php?$1 [PT,L,QSA]
&lt;/pre&gt;Now on line 5 of this code, change the &#39;/blog&#39; with the project directory name of your project, suppose your project name is &#39;mywebapp&#39; then line 5 should look like this:&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;RewriteBase /mywebapp
&lt;/pre&gt;Now save this file as .htaccess in your project folder &#39;mywebapp&#39;, over here my project name was &#39;blog&#39;.&lt;br /&gt;
&lt;br /&gt;
&lt;hr/&gt;&lt;br /&gt;
&lt;h2 style=&quot;text-align: left; font-size:16px;&quot;&gt;Step 2 - enable mod_rewrite&lt;/h2&gt;&lt;br /&gt;
Goto your apache directory, find the httpd.conf file, open it using notepad and find the following line:&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;#LoadModule rewrite_module modules/mod_rewrite.so
&lt;/pre&gt;Edit that line and remove the # symbol to enable loading of the module in apache. The line should now look like this:&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;LoadModule rewrite_module modules/mod_rewrite.so
&lt;/pre&gt;&lt;br /&gt;
&lt;hr/&gt;&lt;br /&gt;
&lt;h2 style=&quot;text-align: left; font-size:16px;&quot;&gt;Step 3 - enable url overwriting&lt;/h2&gt;&lt;br /&gt;
Now in the same httpd.conf file, search for the line &lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;AllowOverride none
&lt;/pre&gt;Modify it like this:&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;AllowOverride all
&lt;/pre&gt;now save your file and close it.&lt;br /&gt;
&lt;br /&gt;
&lt;hr/&gt;&lt;br /&gt;
&lt;h2 style=&quot;text-align: left; font-size:16px;&quot;&gt;Step 4 - edit your project configuration&lt;/h2&gt;&lt;br /&gt;
Goto your Yii project directory and open the main.php file from config directory, find the following code:&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;&#39;urlManager&#39;=&gt;array(
         &#39;urlFormat&#39;=&gt;&#39;path&#39;,
        ...
&lt;/pre&gt;Modify it and add the following code on the third line:&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;&#39;showScriptName&#39;=&gt;false,
&lt;/pre&gt;Now your config file should be looking like this&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;&#39;urlManager&#39;=&gt;array(
         &#39;urlFormat&#39;=&gt;&#39;path&#39;,
                &#39;showScriptName&#39;=&gt;false,
&lt;/pre&gt;Save the file.&lt;br /&gt;
&lt;br /&gt;
&lt;hr/&gt;&lt;br /&gt;
&lt;h2 style=&quot;text-align: left; font-size:16px;&quot;&gt;Step 5 - View project in browser&lt;/h2&gt;&lt;br /&gt;
Now goto your browser and navigate to your project url, eg -&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;http://localhost/[project-name]
&lt;/pre&gt;&lt;br /&gt;
&lt;hr/&gt;Tada, you made it, the index.php is vanished from your urls... yippee!</content><link rel='replies' type='application/atom+xml' href='http://codeyii.blogspot.com/feeds/5384024503217429977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codeyii.blogspot.com/2012/04/remove-indexphp-from-yii-project-url.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3489617876076899900/posts/default/5384024503217429977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3489617876076899900/posts/default/5384024503217429977'/><link rel='alternate' type='text/html' href='http://codeyii.blogspot.com/2012/04/remove-indexphp-from-yii-project-url.html' title='Remove index.php from Yii project URL'/><author><name>PsyCoder</name><uri>http://www.blogger.com/profile/09909438129542990779</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3489617876076899900.post-3573260706324675991</id><published>2012-04-04T01:06:00.001-07:00</published><updated>2012-04-04T01:11:09.755-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Getting started"/><title type='text'>How to setup Yii with WAMP server</title><content type='html'>In this tutorial, you&#39;ll learn how to configure windows path variables and set up Yiic tool on a windows machine with wamp server.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Requirements:&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.yiiframework.com/&quot; target=&quot;_blank&quot;&gt;Yii Framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Windows XP/Vista/7&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.wampserver.com/en/&quot; target=&quot;_blank&quot;&gt;Wamp server&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;
Unzip Yii framework to your webroot directory, Example in wamp server, unzip to &quot;wamp/www/yii&quot; directory. The structure should look like this :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw-nJxKZ1mmV5uXd33H0cYD-17OzZE8Zcbs__FqkmogDw7boxKAmuCO2OZJ69mR4AyxS-ihP3TaQy4IAtUaEH7n9uZhxKiaWC5w1JfboxzDPpLzQNlvFC8azoVQhG1nleCAvgNkfn0-Ctp/s1600/s.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;291&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw-nJxKZ1mmV5uXd33H0cYD-17OzZE8Zcbs__FqkmogDw7boxKAmuCO2OZJ69mR4AyxS-ihP3TaQy4IAtUaEH7n9uZhxKiaWC5w1JfboxzDPpLzQNlvFC8azoVQhG1nleCAvgNkfn0-Ctp/s320/s.png&quot; width=&quot;248&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;In windows XP/Vista:&lt;/b&gt;&lt;br /&gt;
Goto:&lt;br /&gt;
Start -&gt; My Computer (right click!) -&gt; Advanced Tab -&gt; Environment Variables -&gt; Click Path in System variables -&gt; Edit&lt;br /&gt;
&lt;br /&gt;
In windows 7:&lt;br /&gt;
&lt;br /&gt;
Goto:&lt;br /&gt;
&lt;br /&gt;
Start -&gt; type &quot;env&quot; -&gt; click &quot;Edit the system environment variables&quot; from search results&lt;br /&gt;
&lt;br /&gt;
Click on the variable called PATH and click &quot;Edit...&quot;. Do not delete the paths already there! Separate each path with semicolons.&lt;br /&gt;
&lt;br /&gt;
Now you have to add the following PATHs in Windows: &quot;C:\wamp\bin\php\php5.2.8&quot; and &quot;C:\wamp\www\framework&quot;. The former path should lead where your php.exe resides, and the latter where your yiic.bat resides.&lt;br /&gt;
&lt;br /&gt;
After entering the paths, type cmd in your startmenus searchfield, and go to the webroot. You may have to restart the computer if this does not work for you so that Windows can register the new variables.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;yiic webapp mywebsite
&lt;/pre&gt;&lt;br /&gt;
Will generate a Yii skeleton for your web application inside the directory &quot;mywebsite&quot; in your WAMP webroot folder. One reason that you should stand in your WAMP webroot when giving the yiic commands is that you don&#39;t have to specify where you want the web application generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhXgdORr2XoDB7ehzPxHPFPuuw-IQElexd6fhShPR2qk7-F12dl24X7jsXvXT1NUCpnMjWZ7yja0Sk-DB9m-n7i61kLJXhC8ESLrw-x3Hyf7DsTANwQWjXc60HMha9kqzk_SMaRHdZUwe/s1600/s.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; width=&quot;216&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhXgdORr2XoDB7ehzPxHPFPuuw-IQElexd6fhShPR2qk7-F12dl24X7jsXvXT1NUCpnMjWZ7yja0Sk-DB9m-n7i61kLJXhC8ESLrw-x3Hyf7DsTANwQWjXc60HMha9kqzk_SMaRHdZUwe/s320/s.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeyii.blogspot.com/feeds/3573260706324675991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codeyii.blogspot.com/2012/04/how-to-setup-yii-with-wamp-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3489617876076899900/posts/default/3573260706324675991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3489617876076899900/posts/default/3573260706324675991'/><link rel='alternate' type='text/html' href='http://codeyii.blogspot.com/2012/04/how-to-setup-yii-with-wamp-server.html' title='How to setup Yii with WAMP server'/><author><name>PsyCoder</name><uri>http://www.blogger.com/profile/09909438129542990779</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw-nJxKZ1mmV5uXd33H0cYD-17OzZE8Zcbs__FqkmogDw7boxKAmuCO2OZJ69mR4AyxS-ihP3TaQy4IAtUaEH7n9uZhxKiaWC5w1JfboxzDPpLzQNlvFC8azoVQhG1nleCAvgNkfn0-Ctp/s72-c/s.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3489617876076899900.post-892921394784943734</id><published>2012-04-04T00:50:00.002-07:00</published><updated>2012-04-04T01:00:54.710-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Getting started"/><title type='text'>Create a new project using Yii command line</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Getting started with Yii? yes, you made the right choice of PHP framework to develop powerful web apps in no time and absolute professionalism. Yii is a high-performance PHP framework best for developing large-scale Web applications. Before you get started with the &lt;a href=&quot;http://www.yiiframework.com/&quot;&gt;Yii framework&lt;/a&gt;, you must &lt;a href=&quot;http://www.yiiframework.com/download/&quot;&gt;download a copy&lt;/a&gt; of the framework.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;center&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.yiiframework.com/download/&quot;&gt;&lt;br /&gt;
&lt;img border=&quot;0&quot; height=&quot;40&quot; src=&quot;https://encrypted-tbn2.google.com/images?q=tbn:ANd9GcQ8yZHrdDWsq1z8lfNLhIT5uzwC4k1o-l0hyuKfBY4Cq331Qa6Pwg&quot; /&gt;&lt;br /&gt;
&lt;b&gt;Click here&lt;/b&gt;&lt;/a&gt; to download directly.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sourceforge.net/projects/yii/files/yii/&quot;&gt;&lt;br /&gt;
&lt;img border=&quot;0&quot; height=&quot;40&quot; src=&quot;https://encrypted-tbn2.google.com/images?q=tbn:ANd9GcQ8yZHrdDWsq1z8lfNLhIT5uzwC4k1o-l0hyuKfBY4Cq331Qa6Pwg&quot; /&gt;&lt;br /&gt;
&lt;b&gt;Click here&lt;/b&gt;&lt;/a&gt; to download from sourceforge.&lt;br /&gt;
&lt;/center&gt;&lt;br /&gt;
&lt;br /&gt;
Now unzip the package to your webroot. Example in wamp server, unzip to &quot;wamp/www/yii&quot; directory. The structure should look like this :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw-nJxKZ1mmV5uXd33H0cYD-17OzZE8Zcbs__FqkmogDw7boxKAmuCO2OZJ69mR4AyxS-ihP3TaQy4IAtUaEH7n9uZhxKiaWC5w1JfboxzDPpLzQNlvFC8azoVQhG1nleCAvgNkfn0-Ctp/s1600/s.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;291&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw-nJxKZ1mmV5uXd33H0cYD-17OzZE8Zcbs__FqkmogDw7boxKAmuCO2OZJ69mR4AyxS-ihP3TaQy4IAtUaEH7n9uZhxKiaWC5w1JfboxzDPpLzQNlvFC8azoVQhG1nleCAvgNkfn0-Ctp/s320/s.png&quot; width=&quot;248&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;Now you just need to enter the following command using command line:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;yiic webapp mywebsite
&lt;/pre&gt;&lt;br /&gt;
You will be asked for confirmation of creating a directory structure, press &#39;Y&#39; then.&lt;br /&gt;
&lt;br /&gt;
Now your project will be ready, with the following directory structure in your webroot directory:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhXgdORr2XoDB7ehzPxHPFPuuw-IQElexd6fhShPR2qk7-F12dl24X7jsXvXT1NUCpnMjWZ7yja0Sk-DB9m-n7i61kLJXhC8ESLrw-x3Hyf7DsTANwQWjXc60HMha9kqzk_SMaRHdZUwe/s1600/s.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; width=&quot;216&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhXgdORr2XoDB7ehzPxHPFPuuw-IQElexd6fhShPR2qk7-F12dl24X7jsXvXT1NUCpnMjWZ7yja0Sk-DB9m-n7i61kLJXhC8ESLrw-x3Hyf7DsTANwQWjXc60HMha9kqzk_SMaRHdZUwe/s320/s.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Now you can access your webapp created by navigating to the following url on your browser:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;http://localhost/mywebsite
&lt;/pre&gt;&lt;br /&gt;
This was the getting started tutorial for creating a new project using the Yii Framework... keep checking for more tutorials. Thanks.&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeyii.blogspot.com/feeds/892921394784943734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codeyii.blogspot.com/2012/04/create-new-project-using-yii-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3489617876076899900/posts/default/892921394784943734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3489617876076899900/posts/default/892921394784943734'/><link rel='alternate' type='text/html' href='http://codeyii.blogspot.com/2012/04/create-new-project-using-yii-command.html' title='Create a new project using Yii command line'/><author><name>PsyCoder</name><uri>http://www.blogger.com/profile/09909438129542990779</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw-nJxKZ1mmV5uXd33H0cYD-17OzZE8Zcbs__FqkmogDw7boxKAmuCO2OZJ69mR4AyxS-ihP3TaQy4IAtUaEH7n9uZhxKiaWC5w1JfboxzDPpLzQNlvFC8azoVQhG1nleCAvgNkfn0-Ctp/s72-c/s.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>