定制 ibnsultan/mimosa 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ibnsultan/mimosa

最新稳定版本:v0.1.1

Composer 安装命令:

composer create-project ibnsultan/mimosa

包简介

a minimalistic PHP+reactJS Combo

README 文档

README

A minimalist php + reactJS framework

It is designed to seamlessly integrate PHP and ReactJS without the need for complete separation between frontend and backend layers.

composer create-project ibnsultan/mimosa YOUR_PROJECT_NAME

Structure

📁 project/
├── 📁 app/
|   ├── 📁 console/
│   ├── 📁 controllers/
│   ├── 📁 lib/
│   ├── 📁 routes/
│   ├── 📁 views/
│   │   ├── 📁 ScreenName/
│   │   └── 📁 Layouts/
│   └── 🐘 Controller.php
├── 📁 config/
├── 📁 public/
│   └── 📄 index.php
├── 📁 vendor/
├── ⚙️ .env
├── ⚙️ .htaccess
├── 📎 composer.json
├── 🐘 index.php
└── 📄 mimic

Features

  • Exceptions and Error Handler
  • HTTP Utils (Routing, Response, Requests)
  • Autoloading
  • Authorization & Authentication (Beta)
    • Login and Registration
    • Session based authentication
    • Token Based authentication (For API request)
    • Pasword Reset Implentation
  • Database
    • Models
    • Migrations

Basic Usage

Mimosa is insanely easy to use due to its simplistic and minimalistic design, it already comes in with some basic components implemented in it like routing, a way handle and render requests and responses respectively

Routing

All routes are preload in the app/routes directory thefore any file defined in routes would automatically be loaded into your application

Basic Routing

app->get('/', function(){
  echo 'hello world!';
});

Routing with a Class

app->get('/', 'MyController@index');

Response

Markup

response()->markup('<h1>Hello</h1>');

Json

response()->json([
  'status' => 'success',
  'data' => 'Hello',
]);

With Header

response()->withHeader('key', 'value')->json([
  'status' => 'success',
  'data' => 'Hello',
]);

Other Methods

Responce comes with other methods like plain, xml, page, download etc

Request

The request object provides an interface for accessing and manipulating the current HTTP request being handled by your application, as well as retrieving input, cookies, and files that were submitted with the request.

request()->get('key');

The request method in request works with all request methods, whether it's get, post or file, it can even get multiple values at once or even suplements a defualt when the value is null.

Multiple

$data = request()->get(['username', 'password']);

// results: array( 'username' => 'value', 'password' => 'value' )

Some other request methods include file, param, try, rawData etc

Documentation

More will be covered in the Documentation section which is still in preparation, keep your eyes on the wiki section

Contributions

Opinions, suggestion, pull requests, and anything of value

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-05