itomori/itomori

There is no license information available for the latest version (1.0.3) of this package.

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:Twig

Type:project

1.0.3 2022-11-10 15:08 UTC

This package is auto-updated.

Last update: 2024-05-26 23:58:16 UTC


README


68747470733a2f2f692e696d6775722e636f6d2f496e537a7652342e706e67

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d312e302e312d677265656e2e737667 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667

Installing

composer create-project itomori/itomori

Todos

  • Middleware
  • Authentication

Routing

Available Methods

Route::get($uri, $callback);
Route::post($uri, $callback);
Route::put($uri, $callback);
Route::delete($uri, $callback);
Route::options($uri, $callback);
Route::patch($uri, $callback);

Basic Routing

Router::get('/', function () {
    MainController::index();
});

Route Parameters

Router::get('/user/{id}', function ($id) {
    MainController::index($id);
});

Controllers

Basic controllers

<?php

namespace App\src\Http\Controllers;

use Obsidian\Core\Controller;

class MainController extends Controller
{
    public static function index()
    {
        self::view('index');
    }
}

Single Action Controllers

<?php

namespace App\src\Http\Controllers;

use Obsidian\Core\Controller;

class MainController extends Controller
{
    public function __invoke()
    {
        self::view('index');
    }
}

Models

Basic models

<?php

namespace App\src\Models;

use Obsidian\Core\Model;

class SampleModel extends Model
{
    protected $id;

    public function __construct()
    {
        $this->table = 'table_name';
    }

    public function getId()
    {
        return $this->id;
    }

    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }
}

Call models

$articleModel = new ArticleModel();
$articleModel->findAll();

CLI

Create controller

php itomori make -c controller_name

Create model

php itomori make -m model_namme