joonika / joonika
light open source php framework
Installs: 385
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 0
Language:JavaScript
Type:framework
Requires
- php: >=7
- ext-curl: *
- ext-gd: *
- ext-json: *
- ext-pdo: *
- ext-soap: *
- ext-yaml: *
- ext-zip: *
- catfan/medoo: ^2.1.2
- composer/installers: *
- curl/curl: *
- doctrine/annotations: ^1.11
- ezyang/htmlpurifier: *
- fzaninotto/faker: *
- hisune/echarts-php: 1.0.12
- nesbot/carbon: ^2.42.0
- phpfastcache/phpfastcache: ^7.1
- phpoffice/phpspreadsheet: ^1.6
- phpseclib/phpseclib: 2.0
- symfony/console: *
- symfony/http-foundation: ^5.1
- twig/twig: *
- whichbrowser/parser: 2.1.1
- zircote/swagger-php: *
Requires (Dev)
README
Install
curl -s https://get.joonika.com | bash && sh installer
During install Notes
if your domain has hosted on another port than 80,443
for domain answer please fill domain.com:9090
if you want to create file for that domain:port: just replace colon with underline(_)
domain.com_9090.yaml
joonika toolkit
Top instruction
php joonika app:init
for initial new website
php joonika app:update
update assets for public folder -> publish
structure
after update public your project this structure will be shown
root folders:
config/websites // location of site config > *.yaml
config/SortMiddleWare.php // order of middlewares run -> if not set by folder order
modules/ // modules location
storage folder auto generated by app:update
storage/files
storage/langs
storage/logs
storage/views
modules/ // modules location
in themes folder you can use every theme for multi domain websites
module structure
assets/* // static assets files for using by theme or Views
Controllers/*
Traits/*
src/*
Views/*
controller methods
you can use two method (post|get)
public function get_index(){ } public function post_index(){ }
calling by url
Example:
GET: localhost/en/sample/inquiry/mobile
this url parse:
localhost: domain
en: language slug
sample: module
inquiry: controller
mobile: method
namespace Modules\sample\Controllers; class inquiry extends Controller public function get_mobile(){ } }
Controller Available Methods
Permission Check
$this->hasPermission('users');
Validate Check
$this->validate(['q|required,min:10,max:11']);
Available Methods:
required
max:(value) (Ex: max:10)
min:(value) (Ex: min:10)
Response
Success
this->setResponseSuccess($data,$success=true); // you can response success as false in 200 (http status success)
{ "success": true, "data": [ ] }
Error
this->setResponseError($alert,$exit=false,$code=null); // $alert text can be string or array // if(array) $alert = [ "message"=>"sample message", "source"=>"sample message", // where happend -> file path or controller name or field name "data"=>"sample message", // string or array ]; // if you want to exit code and not continue after // you can change http status code else 200
{ "success": false, "errors": [ {"message":"sample message"} ] }
###TWIG