Skip to content

ptejada/f3-hmvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A FatFreeFramework(f3) HMVC template

When you clone this repo make sure to run these commands to initialize and fetch the f3 framework:

git submodule init
git submodule update

Consider the following directory and file structure:

app/
  + main/
    + controllers/
      - Controller.php  (Default module controller)
        > index()
        > page2()
        ...
      - Other.php       (Additional controller)
        > index()
        > page2()
        ...
      ...
    + dict/             (LOCALES, optional)
      - en.ini
      - ru.ini
      ...
    + models/
      - User.php
      - Group.php
      ...
    + views/
      - index.html
      - page2.html
      ...
  + blog/
    + controllers/
      - Controller.php  (Default module controller)
        > index()
        > page2()
        ...
      - Other.php       (Additional controller)
        > index()
        > page2()
        ...
      ...
    + dict/             (LOCALES, optional)
      - en.ini
      - ru.ini
      ...
    + models/
      - User.php
      - Group.php
      ...
    + views/
      - index.html
      - page2.html
      ...

Lets assume this repo is sitting at the root of localhost http://localhost/. The following table shows which controller and method is called per request.

URI Controller Call
http://localhost/ app/main/controllers/Controller.php > index()
http://localhost/blog app/blog/controllers/Controller.php > index()
http://localhost/blog/page2 app/blog/controllers/Controller.php > page2()
http://localhost/blog/other app/blog/controllers/Controller.php > other()
http://localhost/blog/other/action app/blog/controllers/Other.php > action()

To add your own f3 configuration and routes add a config.ini file in the root. The only configuration option this template uses is DefaultModule. As the name implies this option will set the default module. For example if you want to use a module called landing as the default module the config.ini file should include:

[globals]
DefaultModule = landing

Note: The default controller for any module will always be Controller.php

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published