Zend Framework

Zend Framework是開發Web Application的開源框架。Zend Framework的特色:

    • 使用PHP 5,最低要求PHP 5.2.4以上的版本。

    • 完全100%物件導向的程式碼。

    • 鬆耦合的元件架構,稱為隨意使用(use-at-will)的設計,各元件之間具有低相依性,也就是可以單獨使用框架中的元件,Zend Framework也稱為元件程式庫(component library)。

    • 實現MVC設計模式。

    • 資料庫抽象層,簡化資料庫的操作。

    • 表單元件,顯示HTML標記與資料確認功能。

    • 使用者驗證(authentication)與授權(authorization)功能。

    • 用戶端元件,存取其他的網路服務。

    • Zend Framework主要的發起者是Zend Technologies Ltd.

元件概觀

Zend Framework目前總計68個元件,主要可以分成下列8類:

    1. Model-View-Controller (MVC)

    2. Tooling and Rapid Application Development (RAD)

    3. Database

    4. Internationalization (i18n) and Localization (l10n)

    5. Authentication, Authorization, and Session management

    6. Web and Web Services

    7. Mail, Formats, and Search

    8. Core Infrastructure

專案結構

Zend Framework應用程式是以「專案(project)與模組(module)」為基礎的設計,官方建議程式碼的檔案結構如下安排:

    • <project name>/

      • application/

        • configs/

        • application.ini

        • controllers/

        • helpers/

        • forms/

        • layouts/

          • filters/

          • helpers/

          • scripts/

        • models/

        • modules/

        • services/

        • views/

          • filters/

          • helpers/

          • scripts/

        • Bootstrap.php

      • data/

        • cache/

        • indexes/

        • locales/

        • logs/

        • sessions/

        • uploads/

      • docs/

      • library/

      • public/

        • css/

        • images/

        • js/

        • .htaccess

        • index.php

      • scripts/

        • jobs/

        • build/

      • temp/

      • tests/

MVC架構