smitter / smitter
Agile, Extensible, Modular PHP Framework
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
Type:project
Requires
- smitter/framework: ^1.1.2
This package is auto-updated.
Last update: 2024-05-30 00:42:07 UTC
README
About Smitter
Smitter is a modular, fast, secure and highly extensible PHP framework built for providing closer to native PHP development experience while following the MVC pattern to its core. The purpose of this framework is to maintain the fun and remove the pain of development process while keeping the scalability, security and performance fine tuned irrespective of project conditions.
Features
- Simple, maintainable, extensible and robust development layer for hassle free and quickest development
- Easiest Public API for implementing all services
- Setting up a project is as quick and fun, as your smile :)
- Built over a powerful service dependency injection layer
Installation
-
Using composer:
composer create-project smitter/smitter
-
Using clone:
git clone https://github.com/adizsandy/smitter
After successfull clone, do not forget to run -
composer update
, which will install all dependencies.
Basic Documentation
Basic structure of framework is as follows:
-
~/app/
All module related codes reside within this folder.To define a module,
<Wrapper>/<ModuleName>
folder structure must be followed. For any new module, register module information withinregister.php
as :// Unique Standard Module Name 'Wrapper_ModuleName' => [ // SWITCH: Turn active/inactive a given module 'active' => true, /** * INHERITANCE: If given module is a submodule or dependant on other modules, if there is any, put 'Standard Module Name' of that parent module for the same Only single inheritance is allowed for now. */ 'parent' => false ]
A
Wrapper
is recommended to include modules of same kind or submodules. Any submodule is defined as a parallel module within same wrapper, justparent
field is set to the name ofParentModuleName
in module registry.For example, to define a sub-module of
Wrapper_ModuleName
,<Wrapper>/<SubModuleName>
folder structure must be followed.Within
register.php
:// Unique Standard Module Name 'Wrapper_SubModuleName' => [ 'active' => true, 'parent' => 'Wrapper_ModuleName' ]
Each module consist of a module definition file
module.php
androutes.php
, which has module declarations and module specific route definitions respectively.Folder structure within module consists of
Controller
,Design
[layouts
,templates
],Model
folders with respective functionalities.Controller
:In Smitter, Controllers are just plain and independent PHP classes, used for handling the requests and providing the response.
All extensible features like Request Parameters, Response Processe, Session etc. can be handled by the helper functions available with equivalent names :)namespace App\Main\Module\Controller; class HomeController { //..... code resides here }
Model
:Model classes include business logics that maybe database related depending on requirements.
If database related logics are to be handled, the class should extend the
Illuminate\Database\Eloquent\Model
class, for implementing the complete ORM features ofEloquent ORM
and mapping the model as an databaseEntity
.However if you need to just run SQL queries anywhere within your codebase, you may use the
db()
function, which returns the Eloquent instance.namespace App\Main\Module\Model; use Illuminate\Database\Eloquent\Model; class User extends Model { protected $table = 'users'; }
Design
: It includes the VIEW logics, havinglayouts
andtemplates
folder.By default,
Main_Module
is provided for quick setup of simple and uni-modular web applications along with some basic information for creation of other modules. -
~/boot/
This folder contains files for bootstrapping the application along with its dependencies -
~/config/
This folder consists all configuration files -
~/lib/
Any third party libraries or common services resides within this folder All services must haveLibrary\\
namespace prefixed. -
~/misc/
Miscellaneous files like helper functions or configurating constants lies in it -
~/public/
All public assets or public domain files reside within it -
~/vendor/
All composer installed packages/dependencies
For setting configurations of project, use ~/.env.example
file and register respective details after renaming it as : ~/.env
All public assets can be saved within ~/public/
folder.
In production environment, DO NOT REMEMBER to redirect your server to public folder via htaccess
as rest of the folders are kept as private folder over production environment.