YiiFramework的应用程序框架

I am looking for a skeleton application for the YiiFramework to get me up-and-running with a simple PHP application I would like to build. Some requirements are:

  • A login/authentication system that keeps the current user's session state (and is secure from injection attacks, etc).
  • It connects to a back-end database (MySql).
  • Has an example table display that demonstrates CRUD operations. i.e. List records from a specific table, a form to edit a specific record as well as pagination and basic search filter.
  • A menu framework that can be easily added to.
  • (Ideally) A pre-existing, visually appealing theme.
  • (Ideally) Has a structure that supports language localisation.
  • (Ideally) Has a framework for a REST API.

I have seen https://github.com/clevertech/yiibooster which provides a nice set of components that would take care of these requirements, however from what I understand, all the above would still need to be assembled. I know that the YiiFramework is designed to make quick work of this, however I have never used any of these frameworks before and would learn much quicker from a pre-existing example/template (and/or existing Yii application) rather than going through the documentation.

Any help appreciated.

As mentioned by @Bizley, Yii2 Advanced Project Template is a very good starting point to learn the concepts & get hands on with Yii2.

There are several other Yii2 templates available & most of them have been developed by customizing and/or adding features to the Yii2 Advanced Template. Just for your reference here are some Yii2 templates (in no particular order) -

yii2-improved-advanced-template

http://www.yiiframework.com/extension/yii2-improved-advanced-template/

Introduction

Yii2-advanced-template is based on yii2-app-advanced created by yii2 core developers. There are several upgrades made to this template.

This template has additional features listed in the next section. Application structure has been changed to be 'shared hosting friendly'.

Features

  • Signup with/without account activation
  • Login using email/password or username/password combo.
  • Rbac tables are installed with other migrations when you run yii migrate command.
  • Users with editor+ roles can create articles.
  • Session data is stored in database out of the box.
  • System setting are stored in config/params.php file ( changes from v2 ).
  • Theming is supported out of box.
  • Translation is supported out of the box.
  • Administrators and The Creator can manage users ( changes from v2 ).
  • Password strength validation and strength meter.
  • All functionalities of default advanced template are included in this template.
  • Code is heavily commented out.

Yii2 Practical App

http://demos.krajee.com/app-practical

Why yii2-app-practical?

After installing a app in the yii2-advanced application you normally would access the frontend from http://domain/app/frontend/web.

However, in many practical scenarios (especially on single domain hosts) one would want their users to directly access frontend as:http://domain/app

The yii2-app-practical enables you to achieve just that by carefully moving and rearranging the bootstrap files and web components of frontend to work directly out of the app root. The frontend/web is entirely eliminated and one can directly access the application frontend from http://domain/app

All other aspects of the app configuration remain the same as the yii2-advanced app. The common, backend and console will remain as is. The frontend config, assets, models, controllers, views, widgets and components, will still reside within the frontend directory. It is just the web access that is moved out to app root.

Yii 2 Starter Kit

https://github.com/trntv/yii2-starter-kit

This is Yii2 start application template.

It was created and developing as a fast start for building an advanced sites based on Yii2.

It covers typical use cases for a new project and will help you not to waste your time doing the same work in every project

FEATURES

  • Beautiful and open source dashboard theme for backend AdminLTE 2
  • Translations: English, Spanish, Russian, Ukrainian, Chinese
  • Translations Editor
  • Language change action + behavior to choose locale based on browser preferred language
  • Sign in, Sign up, profile(avatar, locale, personal data), email activation etc
  • OAuth authorization
  • User management
  • RBAC with predefined guest, user, manager and administrator roles
  • RBAC migrations support
  • Content management components: articles, categories, static pages, editable menu, editable carousels, text blocks
  • Key-value storage component
  • Application settings form (based on KeyStorage component)
  • Ready-to-go RESTful API module
  • File storage component + file upload widget
  • On-demand thumbnail creation trntv/yii2-glide
  • Command Bus with queued and async tasks support trntv/yii2-command-bus
  • Useful behaviors (GlobalAccessBehavior, CacheInvalidateBehavior, MaintenanceBehavior)
  • Yii2 log web interface
  • Application timeline component
  • Cache web controller
  • Maintenance mode component (more)
  • System information web interface
  • dotenv support
  • ExtendedMessageController with ability to replace source code language and migrate messages between message sources
  • Aceeditor widget
  • Datetimepicker widget,
  • Imperavi Reactor Widget,
  • Elfinder Extension
  • Xhprof Debug panel
  • Extended IDE autocompletion
  • Nginx config example
  • Test-ready
  • Docker support and Vagrant support
  • Built-in mailcatcher
  • Assets compression and concatenation
  • Some useful shortcuts
  • many other features i'm lazy to write about :-)

I guess these should be more than enough to get you started.