aurmil/slim2-skeleton 问题修复 & 功能扩展

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

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

aurmil/slim2-skeleton

最新稳定版本:v1.0.8

Composer 安装命令:

composer create-project aurmil/slim2-skeleton

包简介

A Slim Framework 2 application skeleton

README 文档

README

What's included?

  • Slim v2
  • Twig v1
  • Monolog v1
  • Symfony Yaml Component v3

Installation

Required: Composer

Run the following command, replacing [your-project-name] with the name of the folder you want to create.

composer create-project aurmil/slim2-skeleton [your-project-name]
  • Create a virtual host that points to your project path /public
  • For Apache, make sure it has AllowOverride All for Slim URL rewriting
  • Make sure var folder is writable by Web server

Web server choice

This skeleton includes a .htaccess file for Apache.

Feel free to read the Slim documentation if your prefer to use another Web server like nginx.

Configuration

Application configuration is stored in /app/config.yml which is divided into 2 main parts: general settings and environment-specific settings.

Environment settings are grouped within sections. A section = an environment. Section name = value of ENVIRONMENT env variable (default = development).

General settings are merged with environment-specific settings. The latter ones overwrite the first ones.

Access config in PHP code

In /app/src/bootstrap.php, the whole configuration is in the $config variable.

In a controller action, only the App section of configuration is available through $app->config('app').

$tmp = $app->config('app')['my_custom_setting_key'];

Access config in Twig template

Only the App section of configuration is in the config variable.

{{ config.my_custom_setting_key }}

Application errors by email

By configuring App.errors.send_email and App.errors.email, you can enable or disable sending email with Monolog when an error occurs.

Meta tags

Every key: value pair you add under App.metas will be output in HTML head section as a meta tag.

Title

Page title is a special case. Obviously, title and title_separator entries won't be output as meta tags like the other ones.

A page title is formed as follows:

  • content of the metaTitle block a template child could define
{% block metaTitle %}my custom page title{% endblock %}
  • if App.metas.title is not empty:
    • if App.metas.title_separator is not empty: add the separator
    • add the config title

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固