Download the PHP package attokit/attobox without Composer
On this page you can find all versions of the php package attokit/attobox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download attokit/attobox
More information about attokit/attobox
Files in attokit/attobox
Package attobox
Short Description Simple PHP framework for developing usage. Provide http request & response processing, router, resource building, and basic ORM supporting.
License MIT
Homepage https://cgy.design/attokit/attobox
Informations about the package attobox
attobox
Simple PHP framework for developing usage. Provide http request & response processing, router, resource building, and basic ORM supporting.
Usage
Use composer
This will generate folder in your website root.
These folders are required in your website root:
/your/web/root
/app #different actions for your website
/assets #all static resources, e.g., images, js
/library #db, custom PHP Class files
/page #PHP pages need to show directly
/record #ORM Record Class files for each table
/route #routes file
/Web.php #basic route extended from base route
You also need these files in your website root:
/your/web/root
/.htaccess
/index.php
for Apache server, cause all http requests will go through , so ...
is the web entrance. In this file, you need to require of attobox framework.
is required. All your custom controllers must be defined as a public method of Class in this file.
Now you can request your website like .
Folders
/app
Each folder require a PHP Class file . Must extended from . And the directory structure of each would be like:
/app/appname
/assets
/library
/page
/record
/Appname.php
Basicly, each app can be treated as vhost. The usage of these folders are same to the folders in the website root.
must extends from , each public method of this Class can be requested as controller like
/assets
All static resources should be stored here. Such as images, js, css, etc. You can makeup whatever folders you like.
The default resource route is , you can request any resource that stored in assets folder. If you have a image file , then you can request it like . You also can adjust the image a little bit by using query string like .
You can checkout all Mimes that supported by attobox in .
/library
You can create your own Class here. Require namespace . If this folder is in , namespace should be .
/page
Simple PHP page can export directly. Can request like , if in app folder request like .
/record
See ORM Support.
/route
Custom route Class file. Public method can be request as controller.
Special route file , cannot use these file names.
ORM Support
Attobox provide simple ORM support. Only for personal dev usage, this framework recommand using sqlite3 for database actions.
Sqlite file must stored in or , for advanced usage, you also need to create some config params in , the sample of this config json file can be found in .
Record Class must create in , must extends from . RecordSet Class must defined in same php file with Record Class. Record Object is based on table row, RecordSet contains Record Objects, and it can be used as a iterator, each item is a Record Object, result would be an indexed array.
Record Class file like :
CURD
Use catfan/Medoo as db driver.
Common CURD method samples like :
All versions of attobox with dependencies
catfan/medoo Version ^2.0
monolog/monolog Version *
guzzlehttp/guzzle Version *
matthiasmullie/minify Version ^1.3