yii-extension / demo
此包最新版本(dev-master)没有可用的许可信息。
Yii 活跃记录的示例应用
dev-master / 1.0.x-dev
2020-12-02 16:59 UTC
Requires
- php: ^7.4|^8.0
- lasserafn/php-initial-avatar-generator: ^4.1
- npm-asset/axios: ^0.21.0
- npm-asset/buefy: 0.9.4
- npm-asset/bulma-switch: ^2.0.0
- npm-asset/vue: 2.6.12
- nyholm/psr7: ^1.3.0
- symfony/console: ^5.0
- yii-extension/fontawesome: ^1.0@dev
- yiisoft/active-record: ^3.0@dev
- yiisoft/aliases: ^1.0
- yiisoft/assets: ^1.0@dev
- yiisoft/auth: ^1.0
- yiisoft/cache: ^3.0@dev
- yiisoft/cache-file: ^3.0@dev
- yiisoft/composer-config-plugin: ^1.0@dev
- yiisoft/csrf: ^3.0@dev
- yiisoft/data-response: ^3.0@dev
- yiisoft/db-sqlite: ^3.0@dev
- yiisoft/di: ^3.0@dev
- yiisoft/error-handler: ^3.0@dev
- yiisoft/form: ^1.0@dev
- yiisoft/log: ^3.0@dev
- yiisoft/log-target-file: ^3.0@dev
- yiisoft/mailer: ^3.0@dev
- yiisoft/mailer-swiftmailer: ^3.0@dev
- yiisoft/middleware-dispatcher: ^1.0@dev
- yiisoft/profiler: ^3.0@dev
- yiisoft/router: ^3.0@dev
- yiisoft/router-fastroute: ^3.0@dev
- yiisoft/session: ^3.0@dev
- yiisoft/user: ^3.0@dev
- yiisoft/view: ^3.0@dev
- yiisoft/widget: ^3.0@dev
- yiisoft/yii-bulma: ^1.0@dev
- yiisoft/yii-db-migration: ^1.0@dev
- yiisoft/yii-web: ^3.0@dev
- yiisoft/yii-widgets: ^3.0@dev
Requires (Dev)
- codeception/c3: ^2.6.0
- codeception/codeception: ^4.1.5
- codeception/module-asserts: @dev
- codeception/module-db: ^1.0
- codeception/module-phpbrowser: @dev
- phpunit/phpunit: ^9.3
- roave/security-advisories: dev-master
- vimeo/psalm: ^4.0
This package is auto-updated.
Last update: 2024-09-21 23:45:48 UTC
README
Yii 活跃记录的应用示例
使用 db-sqlite 的 Yii 活跃记录示例应用最适合快速创建项目。
目录结构
config/ contains application configurations
resources/layout contains layout files for the web application
resources/mail contains layout and view files for mailer
resources/view contains view files for the web application
src/ application directory
Action contains web action classes
Asset contains assets definition
Form contains form models
Module contains modules application
Theme contains theme application
Service contains web services
Widget continas widgets for web application
需求
本项目模板的最低要求是您的 Web 服务器支持 PHP 7.4.0。
安装
如果您没有 Composer,您可以按照 getcomposer.org 上的说明进行安装。
然后,您可以使用以下命令安装此项目模板
composer create-project --prefer-dist --stability dev yii-extension/demo <your project>
现在,您应该可以通过以下 URL 访问应用程序,假设 app
是位于 public
根目录下的目录。
配置您的应用程序
所有配置都在 application
的 config
目录中。
运行命令行
./yii
运行迁移
./yii migrate/up
使用 PHP 内置服务器
php -S 127.0.0.1:8080 -t public
等待服务器启动,然后在浏览器中打开以下 URL
https://:8080
包括以下功能
-
管理面板仪表板。
- /index - 显示首页。
- /about - 显示关于页面。
- /contact - 显示联系表单页面。
-
用户模块
- /auth/login - 显示登录表单。
- /auth/logout - 用户登出。
- /recovery/request - 显示恢复请求表单。
- /recovery/reset[/{id}/{code}] - 显示密码重置表单(需要 id 和 token 查询参数)。
- /registration/confirm[/{id}/{token}] - 确认用户(需要 id 和 token 查询参数)。
- /registration/register - 显示注册表单。
- /registration/resend - 显示重发表单。
- /admin/index - 显示用户管理界面。
- /admin/create - 显示注册用户表单。
- /admin/block[/{id}] - 允许您阻止或解锁用户。
- /admin/confirm[/{id}] - 确认用户(需要 id)。
- /admin/delete[/{id}] - 删除用户(需要 id)。
- /admin/edit[/{id}] - 显示编辑用户表单(需要 id)。
- /admin/info[/{id}] - 显示用户信息(需要 id)。
- /admin/reset[/{id}] - 发送重发密码的电子邮件(需要 id)。
-
Rbac 模块
- /item/index - 显示项目管理界面。
- /item/create - 显示创建项目表单。
- /item/edit[/{id}] - 显示编辑项目表单(需要 id)。
- /item/delete[/{id}] - 删除项目(需要 id)。
注意:检查 /runtime/mail
目录,电子邮件存储在其中。
Codeception 测试
此包使用 Codeception 进行测试。要运行测试
php -S 127.0.0.1:8080 -t public > yii.log 2>&1 &
vendor/bin/codecept run
静态分析
代码使用 Psalm 进行静态分析。要运行静态分析
./vendor/bin/psalm