{"id":18707,"date":"2015-12-06T05:01:36","date_gmt":"2015-12-05T19:01:36","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=18707"},"modified":"2015-12-05T19:14:04","modified_gmt":"2015-12-05T09:14:04","slug":"yii-mvc-php-framework-hello-world-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/yii-mvc-php-framework-hello-world-tutorial\/","title":{"rendered":"Yii MVC PHP Framework Hello World Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Yii\/\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"Yii MVC PHP Framework Hello World Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Yii\/yii2_hello_world-39of.jpg\" title=\"Yii MVC PHP Framework Hello World Primer Tutorial\"  id=\"xilrb\" onmouseover=\" this.src=this.src.replace('-39of.jpg','-35of.xjpg').replace('-35of.jpg','-36of.xjpg').replace('-36of.jpg','-37of.xjpg').replace('-37of.jpg','-38of.xjpg').replace('-38of.jpg','-39of.xjpg').replace('.x','.'); \"  \/><\/a><p class=\"wp-caption-text\">Yii MVC PHP Framework Hello World Tutorial<\/p><\/div>\n<p>Today&#8217;s tutorial is a Hello World tutorial for <a target=_blank title='Yii landing page' href='http:\/\/www.yiiframework.com\/'>Yii<\/a>, to quote <a target=_blank title='Yii information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Yii'>Wikipedia<\/a> &#8230;<\/p>\n<blockquote><p>\nYii is an open source, object-oriented, component-based MVC PHP web application framework.  Yii is pronounced as &#8220;Yee&#8221; or [ji:] and in Chinese it means &#8220;simple and evolutionary&#8221; and it can be acronym for &#8220;Yes It Is!&#8221;.\n<\/p><\/blockquote>\n<p>The <a target=_blank title='MVC information via Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Model%E2%80%93view%E2%80%93controller'>MVC<\/a> stands for Model View Controller &#8230; (from Wikipedia again) &#8230;<\/p>\n<blockquote><p>\nModel\u2013view\u2013controller (MVC) is a software architectural pattern mostly for implementing user interfaces.\n<\/p><\/blockquote>\n<p>It makes a fair bit of difference what version you talk about with Yii, and we are talking about Yii 2 today.<\/p>\n<p>You can get up and going with a Hello World level of Yii usage really quickly (especially with the great advice of <a target=_blank href='http:\/\/code.tutsplus.com\/tutorials\/how-to-program-with-yii2-getting-started--cms-22440' title='Yii Hello World useful link'>How to Program with Yii2: Getting Started &#8211; Envato Tuts+ Code Tutorial<\/a> &#8230; thanks), and we can say, basically that the major steps for us, integrating it with <a target=_blank title='MAMP Apache web server for Mac landing page' href='http:\/\/mamp.info'>MAMP<\/a> (Mac Apache local web server) and a Linux operating system involved &#8230;<\/p>\n<ol>\n<li>installing <a target=_blank title='Tool for dependency management in PHP' href='https:\/\/getcomposer.org\/'>composer<\/a>, a tool for dependency management in PHP, via &#8230;<br \/>\n<code><br \/>\ncurl -sS https:\/\/getcomposer.org\/installer | sudo php -- --install-dir=\/usr\/bin<br \/>\ncomposer global require \"fxp\/composer-asset-plugin:~1.1.1\"<br \/>\ncomposer require yiisoft\/yii2<br \/>\nsudo ln -s \/usr\/bin\/composer.phar \/usr\/bin\/composer<\/code><br \/>\n&#8230; <a href=\"#\" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('xli0').style.display='inline'; \" onclick=\"this.style.backgroundColor='green'; document.getElementById('xli0').style.display='inline'; \" style=\"background-color: green;\">\u2139<img decoding=\"async\" id=\"xli0\" style=\"display: none;\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Yii\/yii2_hello_world-35of.jpg\"><\/a> &#8230; that can also be found on the <a target=_blank href='https:\/\/github.com\/' title='GitHib landing page'>GitHub<\/a> source repository<\/li>\n<li>composer setup specific to Hello World project &#8230;<br \/>\n<code><br \/>\ncd ~\/Sites<br \/>\ncomposer global require \"fxp\/composer-asset-plugin:1.0.0-beta2\"<br \/>\ncomposer create-project --prefer-dist yiisoft\/yii2-app-basic hello<\/code><br \/>\n&#8230; <a href=\"#\" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('xli1').style.display='inline'; \" onclick=\"this.style.backgroundColor='green'; document.getElementById('xli1').style.display='inline'; \" style=\"background-color: green;\">\u2139<img decoding=\"async\" id=\"xli1\" style=\"display: none;\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Yii\/yii2_hello_world-36of.jpg\"><\/a> &#8230; in addition we found that we needed to &#8230;<br \/>\n<code><br \/>\nmkdir ~\/Sites\/hello\/vendor\/bower\/bootstrap<br \/>\nmkdir ~\/Sites\/hello\/vendor\/bower\/bootstrap\/dist<br \/>\nmkdir ~\/Sites\/hello\/vendor\/bower\/jquery<br \/>\nmkdir ~\/Sites\/hello\/vendor\/bower\/jquery\/dist<\/code><br \/>\n &#8230;  <a href=\"#\" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('xli2').style.display='inline'; \" onclick=\"this.style.backgroundColor='green'; document.getElementById('xli2').style.display='inline'; \" style=\"background-color: green;\">\u2139<img decoding=\"async\" id=\"xli2\" style=\"display: none;\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Yii\/yii2_hello_world-38of.jpg\"><\/a><\/li>\n<li>create software to help out MAMP via &#8230;<br \/>\n<code><br \/>\ncd \/Applications\/MAMP\/htdocs<br \/>\nln -s ~\/Sites\/hello\/ \/Applications\/MAMP\/htdocs\/hello<\/code><br \/>\n &#8230;  <a href=\"#\" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('xli3').style.display='inline'; \" onclick=\"this.style.backgroundColor='green'; document.getElementById('xli3').style.display='inline'; \" style=\"background-color: green;\">\u2139<img decoding=\"async\" id=\"xli3\" style=\"display: none;\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Yii\/yii2_hello_world-37of.jpg\"><\/a><\/li>\n<li>point your web browser at &#8230;<br \/>\n<code>http:\/\/localhost:8888\/hello\/web<\/code> &#8230; <a href=\"#\" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('xli4').style.display='inline'; \" onclick=\"this.style.backgroundColor='green'; document.getElementById('xli4').style.display='inline'; \" style=\"background-color: green;\">\u2139<img decoding=\"async\" id=\"xli4\" style=\"display: none;\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Yii\/yii2_hello_world-39of.jpg\"><\/a><\/li>\n<\/ol>\n<p>You can do great organizational and fast and guaranteed and consistent PHP web work using Yii Framework.  Just imagine a <a target=_blank title='CRUD information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Create,_read,_update_and_delete'>CRUD<\/a> idea you have, and Yii could be a great option for you. Here&#8217;s a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Yii\/\" title='click picture'>slideshow<\/a> of highlights of today&#8217;s Hello World website create using the Yii 2 MVC PHP framework.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d18707' onclick='var dv=document.getElementById(\"d18707\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mvc\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d18707' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;s tutorial is a Hello World tutorial for Yii, to quote Wikipedia &#8230; Yii is an open source, object-oriented, component-based MVC PHP web application framework. Yii is pronounced as &#8220;Yee&#8221; or [ji:] and in Chinese it means &#8220;simple and evolutionary&#8221; &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/yii-mvc-php-framework-hello-world-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,33,37],"tags":[1751,249,462,495,558,611,707,714,723,744,824,932,1165,1404,1411,1421],"class_list":["post-18707","post","type-post","status-publish","format-standard","hentry","category-elearning","category-software","category-tutorials","tag-composer","tag-configuration","tag-framework","tag-github","tag-hello-world","tag-install","tag-linux","tag-local-web-server","tag-mac","tag-mamp","tag-mvc","tag-php","tag-soft-link","tag-web-browser","tag-web-server","tag-website"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/18707"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=18707"}],"version-history":[{"count":12,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/18707\/revisions"}],"predecessor-version":[{"id":18719,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/18707\/revisions\/18719"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=18707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=18707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=18707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}