Home > Article > Backend Development > Steps to build a website in php
php steps to build a website
php framework website building tutorial
First go to the official website to download the thinkphp3.2.3 version of the framework, or you can git the latest 3.2.3 function
Set the bound module in the index.php entry file define('BIND_MODULE','Project');, the bound module can be defined by yourself, set the application path define('APP_PATH','./myweb/');
##Open the convention.php convention file under ThinkPHP\Conf to set the database connection and other default framework related settings, including database settings, data cache settings, log settings, default settings, template engine settings, layout settings, URL Settings, router settings, etc. Add a static page of index.html under the folder myweb\Project\View\Index as the output template<div class="showtext tit"> <ul> <li>用户名</li> <li>密码</li> <li>姓名</li> <li>手机号</li> <li>email</li> </ul> </div> <div class="showtext"> <ul> <foreach name="list" item="item" key="ix" > <li>{$item["user_name"]}</li> <li>{$item["password"]}</li> <li>{$item["real_name"]}</li> <li>{$item["phone_num"]}</li> <li>{$item["email"]}</li> </foreach> </ul> </div>Add some simple data tests Create a controller in myweb\Project\Controller to call, calculate, display and distribute the entire program, and pass the data through $ This->assign is used to assign values to the template, and $this->display() is used to render the template and output the data. It can be found under myweb\Project\Model Establish a data model and interact with the table through the D method or the m method. The memberModel.class.php file before the Model represents the name of the table member NotesYou can also call the output directly without the modeldisplay needs to be called after assignFor more PHP related knowledge, please visit
PHP中文网!
The above is the detailed content of Steps to build a website in php. For more information, please follow other related articles on the PHP Chinese website!