定制 newtron/app 二次开发

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

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

newtron/app

最新稳定版本:0.1.5

Composer 安装命令:

composer create-project newtron/app

包简介

PHP framework designed around the principle of complex features with embarrassingly simple code

README 文档

README

newtron

A fresh Newtron application ready for you to build something amazing.

About Newtron

Newtron is a PHP framework built around one core principle: complex features should require embarrassingly simple code. It's built to solve real developer pain points by making common, complex tasks trivially simple.

Current Status

Newtron is currently a work in progress. In it's current state, Newtron can support simple static sites.

✅ Phase 1 Complete: Core foundation

  • Application container with dependency injection
  • Request/Response abstraction
  • Two routing modes (declarative or file-based)
  • Middleware pipeline
  • Quark, a custom templating engine
  • Error handling and logging

🚧 Up Next: Developer experience improvements and the signature forms system

Requirements

  • PHP 8.3 or higher
  • Composer

Installation

composer create-project newtron/app my-app

Quick Start

// Start a development server
cd public && php -S localhost:8000
// Create your first page (file-based routing)
// /routes/hello.php
<?php

use Newtron\Core\Http\Response;
use Newtron\Core\Routing\FileRoute;

class Hello extends FileRoute {
  public function get(): void {
    return;
  }

  public function render(mixed $data): mixed {
    return Response::create('Hello world!');
  }
}

// Or add a new route (declarative routing)
// /routes/web.php
<?php

use Newtron\Core\Http\Response;
use Newtron\Core\Routing\Route;

Route::get('/hello', function () {
  return Response::create('Hello world!');
});


// Visit http://localhost:8000/hello

Project Structure

my-app/
├── app/
│   └── Launcher.php        # Helper for custom initialization
├── config/
│   ├── app.php             # Application configuration
│   └── routing.php         # Routing settings
├── public/
│   ├── favicon.ico
│   ├── index.php           # Application entry point
│   └── styles.css
├── routes/
│   └── welcome.php         # Welcome file-based route
└── templates/
    └── welcome.quark.html  # Quark welcome template

Need Help?

Stay Updated

Newtron is in active development. Watch the repository to get notified when new phases are released.

The best is yet to come! 🚀

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-27