ac/slimfra 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ac/slimfra

Composer 安装命令:

composer require ac/slimfra

包简介

A thin extension of Silex for small projects.

README 文档

README

Slimfra is a thin extension of the Silex microframework for building small(ish) projects. It provides a configurable base application, a simple base controller, and command, which can access the app and its services and configuration.

For documentation on the excellent Silex framework, and examples of how to use it (all of which applies to Slimfra), refer to the Silex documentation.

Slimfra was built for personal use and rapid app development at work in order to easily convert some simple legacy projects into an easier to manage structure. Why is it named Slimfra? Because.

If anyone wishes to contribute, please do, but we recommend contributing to Silex for things that would be of benefit to the broader community.

Installation & Use

Require "ac/slimfra":"0.1.0" in your composer.json. Then run composer update ac/slimfra

Set your project up the same as you would any other Silex app.

The base Controller and Command provided both implement ArrayAccess, which lets you refer to the parent app via $this

For example:

$service = $this['some.service.name'];
$config = $this['some.value'];

Controllers

class MyController extends Slimfra\Controller
{
	public function helloWorldAction()
	{
		$service = $this->app['some.service'];

		//...do whatever

		return 'Hello World!';
	}
}


$app = new Slimfra\Application();
$app->get('/hello-world', 'MyController::helloWorldAction');
$app->run();

Commands

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class HelloWorldCommand extends Slimfra\Command
{
	protected function configure()
	{
		$this->setName('hello-world');
	}

	protected function execute(InputInterface $input, OutputInterface $output)
	{
		$service = $this->app['some.service'];

		//... do whatever

		$output->writeln('Hello World!');
	}
}

$app = new Slimfra\Console(new Slimfra\Application());

$app->add(new HelloWorldCommand());

$app->run();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2012-07-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固