承接 philiplambok/mikasa 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

philiplambok/mikasa

Composer 安装命令:

composer require philiplambok/mikasa

包简介

A Simple Model-View-Controller(MVC) PHP Framework

README 文档

README

Packagist

Mikasa!

Mikasa Framework is A Simple MVC(Model View Controller) PHP Framework. Mikasa Framework is suitable with you who familiar with CodeIgniter or just new in this pattern.

Installation

You need to install xampp with >= php 5.6 and composer. The installation we have to option, you can just download or clone this repo.

$ git clone https://github.com/philiplambok/mikasa.git
$ cd mikasa

or you can install with composer [Recomended]

$ composer create-project philiplambok/mikasa myapp --prefer-dist -vvv
$ cd myapp

or just download from stable releases

Usage

In MVC Pattern, you will familliar with Model (Class that interact with database), View (File that handle the UI) and Controller (Class that manage the logic and routing).

You can run the project using build in php server, with type this command :

$ php -S localhost:8000

That command will be running your code in localhost port 8000. You can open your browser and type to url box : http://localhost:8000

Controller

Here is an example of a basic controller.

<?php 

namespace App\Controllers;
use App\Core\Controller;

class HomeController extends Controller 
{
	public function index()
	{
		return $this->view('welcome');
	}
} 

All controller must be extends with class controller, and for using class controller you must use from namespace : use App\Core\Controller. Like i said first, in mikasa framework, controller will be manage the route like CodeIgniter, so on that code will be running in 'http://localhost:8000'. yeah index() method is the default method.

Model

If your program need some logic or interact to database, you can just create the model.

<?php 

namespace App\Models;
use App\Core\Database;

class User extends Database
{
	public $username;

	// get all user in users table.
	public function getList()
	{
	  $sql = 'SELECT * FROM users ORDER BY id';
	  $query = $this->db->query($sql);
	  $result = $query->fetchAll(PDO::FETCH_OBJ);
	  return $result;
	}
}

All model will be extends with Database class. To connection with database, you can using query method in db attr: $this->db->query("query").

Views

All views located in dir : App/Views. You can create some html file and show them with controller. If you need some data in database you just create the model.

Learning Resource

  • Documentation (Comming Soon!)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-06-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固