From aMember Pro Documentation
Revision as of 06:38, 28 June 2011 by Alex (talk | contribs)
Jump to: navigation, search

aMember Pro v.4 is based on Zend Framework's Zend_Controller and follow its guidelines. There is a Bootstrap class that handles all the dependencies and configuration loading.

To get all aMember Pro functions available for your custom script, just include bootstrap.php withing amember/ folder. It does not output any page, just initialises the core.

aMember Pro uses .htaccess file in root folder to route requests to pages. It is done by using of Apache's mod_rewrite by redirecting all requests for not-image files to amember/index.php . index.php runs Zend_Controller_Front routing procedures to include necessary controller class and run it.

Directory layout

    configs/ - configuration files
    default/ - default module
      controllers/ - controller files - it replaces usual PHP "pages". One controller usually represents one "traditional" PHP file
      language/ - translations
      models/   - models : each file represents one database file
        protect/ - 
      Bootstrap.php - module bootstrap file
      db.xml        - database structure configuration file
    newsletter/ - a "newsletter" module. Described here for example
      controllers/  - newsletter module controllers. Accessible like http://www.example.com/am4/newsletter/subscribe
      library/      - newsletter module model classes and other libraries
      views/        - Zend_View templates for newsletter module. All "views" folders are merged to single view path, and module can provide its own version of existing templates
        blocks/     - template "blocks" - small page pieces that can be included/excluded/shuffled via API
    cache/ - cache files
    new-rewrite/ - new-rewrite label files
  library - amember and third-party core libraries
  setup/ - setup folder
  bootstrap.php - initialize amember core
  index.php  - runs page controller and outputs content
  js.php     - accelerator to pack all necessary JS libs to one file and deliver to client
  public.php - accelerator to provide quick access to custom files, specially configurable CSS files in themes