定制 steevedroz/nano-framework 二次开发

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

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

steevedroz/nano-framework

最新稳定版本:1.5.2

Composer 安装命令:

composer require steevedroz/nano-framework

包简介

README 文档

README

DISCLAIMER: This is not a good Framework, its sole purpose is the teaching of the mechanisms behind a Framework. For example, the database is simply a bunch of JSON files that have to be completely rewritten each time a single value is edited. Please consider choosing a real framework if you intend to use this as a base for your website.

NanoFramework is an extremely tiny PHP Framework. Its source code holds in 6 classes and 1 dependency. The goal is to stay clear while learning by allowing the student to not be lost in hundreds of source files.

Installation

In order to install NanoFramework:

  • Create an empty folder on your computer, where your local server asks you to (usually a directory named www or htdocs).
  • From that folder, run the command composer require steevedroz/nano-framework (you may need to install composer beforehand).
  • Run the command vendor/bin/nano-generate, accept the override of composer.json.
  • Run the command composer dumpautoload to reload all the generated files.
  • Run the website and behold the first page!

Usage

This will explain the basic usage of the Framework. For a more in depth explanation, please consider visiting the doc.

MVC

NanoFramework uses the Model-View-Controller architecture.

The flow is the following:

  1. The server recieves a request to a URI.
  2. index.php is called, the route is analyzed.
  3. If the route is referenced in the file called routes, it is changed to its corresponding value.
  4. The route (maybe modified) represents the name of a Controller, the name of a method and parameters (parameters are optional, the method is index if not specified, only the Controller name is required).
  5. The corresponding method of the Controller is called.
  6. That method may call a Model, in order to obtain data from the database.
  7. That method may call a View, possibly passing it the data, in order to generate an HTML file.
  8. The method returns that file that is bubbled up to index.php and displayed on screen.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-17