Getting Started with Zend Framework MVC Applications
2016-07-05 10:36
519 查看
Getting Started with Zend Framework MVC Applications
This tutorial is intended to give an introduction to using Zend Framework 2 by creating a simple database driven application using the Model-View-Controller paradigm. By the end you will have a working ZF2 application and you can then poke around the code to find out more about how it all works and fits together.Some assumptions
This tutorial assumes that you are running at least PHP 5.6 with the Apache web server and MySQL, accessible via the PDO extension. Your Apache installation must have themod_rewriteextension installed and configured.
You must also ensure that Apache is configured to support
.htaccessfiles. This is usually done by changing the setting:
AllowOverride None
to
AllowOverride FileInfo
in your
httpd.conffile. Check with your distribution’s documentation for exact details. You will not be able to navigate to any page other than the home page in this tutorial if you have not configured
mod_rewriteand
.htaccessusage correctly.
Getting started faster
Alternatively, you can use any of the following as well:The built-in web server in PHP. Run
php -S 0.0.0.0:8080 -t public/ public/index.phpin your application root to start a web server listening on port 8080.
Use the shipped
Vagrantfile, by executing
vagrant upfrom the application root. This binds the host machine's port 8080 to the Apache server instance running on the Vagrant image.
Use the shipped docker-compose integration, by executing
docker-compose up -d --buildfrom the application root. This binds the host machine's port 8080 to the Apache server instance running container.
The tutorial application
The application that we are going to build is a simple inventory system to display which albums we own. The main page will list our collection and allow us to add, edit and delete CDs. We are going to need four pages in our website:Page | Description |
---|---|
List of albums | This will display the list of albums and provide links to edit and delete them. Also, a link to enable adding new albums will be provided. |
Add new album | This page will provide a form for adding a new album. |
Edit album | This page will provide a form for editing an album. |
Delete album | This page will confirm that we want to delete an album and then delete it. |
Field name | Type | Null? | Notes |
---|---|---|---|
id | integer | No | Primary key, auto-increment |
artist | varchar(100) | No | |
title | varchar(100) | No |
相关文章推荐
- Android操作系统介绍之11种传感器
- Swift - 是时候学习Swift了
- Android仿淘宝详情页实现上下翻页
- Windows下新建Cocos2d-x V3.10项目(cocos2d-x lua)
- 'adb.exe,start-server' failed — run manually if necessary, Android Studio
- android 利用dwonLoadManager 实现apk下载更新
- Android Butterknife的使用
- Android消息机制Handler的实现原理解析
- Android 时间统计工具,
- 反射获取 application对象
- Android手机屏幕敲击解锁功能代码
- android NFC学习笔记(基础一)
- UIWebView获得网页内容(HTML源码)、加载本地HTML文件
- Android存储空间不足下,APP出现奔溃等情况
- Android APK反编译
- Android Crash解决方案之android.view.WindowManager$BadTokenException
- The ServiceClass object does not implement the required method in the following form
- Android菜鸟学步之启动模式
- dispatch_after的使用及iOS延时实现方法
- Android菜鸟学步之Intent