hgh/fox-framework

The mini framework

v1.2.3 2021-02-21 21:09 UTC

This package is auto-updated.

Last update: 2024-12-22 05:55:31 UTC


README

Fox

This is a mini framework to run some basic web apps.

Table of contents

Installation

require the package by following composer command:

composer require hgh/fox-framework

Folder structure of the framework

The folder structure of the app is:

 - app
 ----- Console
 ---------- Commands
 ----- Http
 ---------- Controllers
 ----- Models
 - public
 ----- index.php
 - resources
 ----- views
 - storage
 ----- logs

Controllers

The controllers to render the web pages. All the controllers must be extended from Fox/Controller/Controller. The parent class will provide some common methods. The list of methods:

  • render
  • json

Models

The models to interact with the database. All the models must be extended from Fox/Database/Model. The parent method will provide some methods to interact with database. The list of all methods:

  • find(static)
  • insert(static)
  • findOne(static)

Console

The commands to run some actions in the CLI. All the consoles must be extended from Fox/Console/Console. Sone notes that must considered:

  • All the commands must have the SIGNATURE const to use in the console. like sample:action
  • SINGATURE may have the arguments. Arguments must be surrounded by the {}. sample:action {sampleArgument}
  • Optional arguments must have ? before the argument name. like sample:action {?sampleArgument}

Environment variables