Fork me on GitHub

Documentation

Introduction

This walkthrough guides you through JiNexus Framework's MVC pipeline — from module configuration and route matching to controller dispatch and view rendering — so you understand how each component fits together when building your application.

Request Flow

Every request to a JiNexus application passes through this pipeline:

  1. Front controller (public/index.php) loads Composer autoloading, reads config/application.config.php, and hands it to ApplicationFactory::build().
  2. Module config aggregation — the factory iterates every module listed in modules.config.php, instantiates its Module class, and merges all getConfig() arrays together.
  3. Route matching — the merged route table is registered on the Route component, which derives the current URI from $_SERVER and looks for a match.
  4. Controller dispatch — the matched controller class is instantiated, and its action method (e.g. indexAction()) is called.
  5. View rendering — the layout template is rendered with the view variables set during dispatch. A 404 response terminates the pipeline when no route matches.

Application Structure

Below is the complete skeleton application structure:

                    
    application_root/
        config/
            application.config.php          Module list reference
            modules.config.php              Enabled module namespaces
        data/
            cache/                            Cache directory (writable)
        module/
            Application/
                config/
                    module.config.php           Route and view-manager config
                src/
                    Module.php                    Application module class
                    Controller/
                        IndexController.php        Default controller
                view/
                    application/index/           View templates
                    error/                       Error page templates
                    layout/                      Layout templates
        public/
            index.php                        Front controller (document root)
            .htaccess                        Apache rewrite rules
            asset/                            Static assets
        test/
            Application/                      Unit tests
        vendor/                              Composer dependencies
                    
                

Each directory and file is covered in detail in the walkthrough pages that follow. Start with the Module Manager section to learn how modules are registered and configured.