未加星标

Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go

字体大小 | |
[开发(php) 所属分类 开发(php) | 发布者 店小二04 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏
Assumed Knowledge or Pre-reqs: Basicphp knowledge; familiarity with the MVC pattern Ideal for: PHP newbies, ASP.net MVC developers wanting to build open source or PHP app Part 1 of 2: Setting Up a Solid Framework The Goal of this Tutorial

This tutorial will walk you through the creation of a simple but full blown web application. In Step 1, we’ll be getting and installing a framework, creating and configuring a database, and setting up the main web app with a login screen. In Step 2, we will be creating an application module to list, add, edit, and delete contacts.

What You'll Need Before We Start

You'll need to have:

A running HTTP Web Server. We’re going to assume you’re using Apache, though the steps for using other servers should be very similar. We might have to play a little with the server configuration. Make sure you have PHP 5.5, 5.6 or 7.x installed and configured.

A database server. We’re going to be using mysql server (or MariaDB) in this tutorial. You’ll need to know enough about SQL in order to create an empty database. Since we’re using SQL, also make sure that you have the pdo_mysql or mysqli extensions enabled in PHP.

Basic PHP knowledge. Any object-oriented programming you’ve done in any language is also helpful.

Finally, you’ll need a basic knowledge of the MVC (Model-View-Controller) programming pattern. A quick overview can be found using Google.

Optional: install GIT version control (see here )

What We are Using

The purpose of this setup is for an enterprise-class web application. There are lots of frameworks out there. But these days, for enterprise apps, there are two major foundational frameworks from which many starter frameworks are based on: Laravel and Codeigniter . So then you need to choose which of these starter frameworks or foundations to build on.

Ignition-Go

For this tutorial, we chose an up-and-coming framework called Ignition-Go because it is similar to a popular one we used to use for many years called Bonfire (and this author is a major contributor). Ignition-Go is modular and has a GUI code generator. Both of the aforementioned are Codeigniter-based. Codeigniter is very easy to work with and have intuitive classes for new PHP developers, especially if you come from a ASP.net MVC background. It's very stable, and now has seen a recent new lease on life with a 3.x release and a new version 4.x in the works.

The Steps Step 1: Get the framework

The first step is to get the framework. Ignition-Go includes Codeigniter so it is one stop shopping. To download it and review the documentation beyond this tutorial, visit the project on GitHub: https://github.com/ci-blox/Ignition-Go and download the latest release package.

If you have GIT, You can also clone the repository using the command line after navigating to your web server htdocs folder:

git clone git://github.com/ci-blox/Ignition-Go igo
Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go

Otherwise, unzip the package to a new folder named "igo" in the htdocs folder of your web server or extract it to a directory on your local machine and copy and paste it under htdocs/igo.

Step 2: NPM

Install NPM node.js: package manager for node modules if you don't have it. See https://nodejs.org/en/

Step 3: Change directory

Open a command line and change directory to the new site folder igo. Example: cd igo


Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go
Step 4: Bower

Install Bower manager for bower components. Type:

npm install -g bower
Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go
Step 5: NPM & Bower components

Install all the NPM and bower components. Type:

npm install
Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go

Then after that...

bower install
Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go

(hint: more should be downloading other than shown; as in if the list is longer do not worry)

Step 6: Gulp

Install and run 'gulp' (note that gulp will run continuously in "watch"mode, watching for css and js changes). Type:

npm install gulp
Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go

Then,

npm install gulp-cli -g
Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go

(gulp-cli -g allows you to put forth a command line interface)

Step 7: MySQL

Create an empty MySQL database called _ci-blox _

Example: use HeidiSQL and create both a database and a user with privileges to new database

Step 8: Run Gulp

Run 'gulp' (note that gulp will run continuously in 'watch' mode, watching for css and js changes).

Type:

gulp serve
Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go

Then after a certain amount of data loads, this should be the end result on the bottom:


Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go
Step 9: Result Go tohttp://[your web root from step 5]/install/init in your browser to finish using install wizard eg (if you had created virtual host igotestlocal.com, then go to http://igotestlocal.com/install/init in your browser).
Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go
Watch out for Part 2!

We're always available to answer any questions you may have at [email protected] .

本文开发(php)相关术语:php代码审计工具 php开发工程师 移动开发者大会 移动互联网开发 web开发工程师 软件开发流程 软件开发工程师

主题: PHPSQLMySQLGulpGitLaravelGitHub
分页:12
转载请注明
本文标题:Creating a Full-blown MVC Web App using PHP5 or PHP7 & Ignition-Go
本站链接:http://www.codesec.net/view/522545.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 开发(php) | 评论(0) | 阅读(68)