• Getting Started with Zend Framework MVC Applications


    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 the mod_rewrite extension installed and configured.

    You must also ensure that Apache is configured to support .htaccess files. This is usually done by changing the setting:

    AllowOverride None

    to

    AllowOverride FileInfo

    in your httpd.conf file. 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_rewrite and .htaccess usage correctly.

    Getting started faster

    Alternatively, you can use any of the following as well:

    • The built-in web server in PHP. Runphp -S 0.0.0.0:8080 -t public/ public/index.php in your application root to start a web server listening on port 8080.
    • Use the shipped Vagrantfile, by executing vagrant up from 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 executingdocker-compose up -d --build from 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:

    PageDescription
    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.

    We will also need to store our data into a database. We will only need one table with these fields in it:

    Field nameTypeNull?Notes
    id integer No Primary key, auto-increment
    artist varchar(100) No  
    title varchar(100) No  
  • 相关阅读:
    索引跳跃式扫描(INDEX SKIP SCAN)
    Oracle参数Arraysize设置对于逻辑读的影响分析
    Oracle的SQL优化思路
    通过SID查找历史执行的SQL语句
    expdp/impdp数据泵分区表导入太慢了。添加不检查元数据参数提高效率:ACCESS_METHOD=DIRECT_PATH
    Oracle不能并行直接添加主键的方法:先建唯一索引后建主键
    ORA-20011 问题处理
    安装grid时找不到ASM共享磁盘
    jmeter-测试计划
    jmeter解压后启动jmeter.bat报错:Not able to find java executable or version
  • 原文地址:https://www.cnblogs.com/chunguang/p/5642692.html
Copyright © 2020-2023  润新知