atm / pointsbundle
1.0.4
2018-03-27 14:57 UTC
Requires
- php: >=5.3.9
Requires (Dev)
- friendsofsymfony/jsrouting-bundle: ^1.6
- knplabs/knp-paginator-bundle: ^2.6
- symfony/asset: ~2.7|~3.0.0
- symfony/console: ~2.8|~3.0.0
- symfony/expression-language: ~2.4|~3.0.0
- symfony/finder: ~2.3|~3.0.0
- symfony/form: ^2.8.23
- symfony/http-kernel: ~2.8|~3.0.0
- symfony/polyfill-intl-icu: ~1.0
- symfony/routing: ~2.2|~3.0.0
- symfony/security: ~2.6|~3.0.0
- symfony/security-acl: ~2.6|~3.0.0
- symfony/stopwatch: ~2.2|~3.0.0
- symfony/templating: ~2.1|~3.0.0
- symfony/translation: ~2.7|~3.0.0
- symfony/var-dumper: ~2.7.16|~2.8.9|~3.0.9
- symfony/yaml: ^2.0.5|~3.0.0
Suggests
- symfony/asset: For using the AssetExtension
- symfony/expression-language: For using the ExpressionExtension
- symfony/finder: For using the finder
- symfony/form: For using the FormExtension
- symfony/http-kernel: For using the HttpKernelExtension
- symfony/routing: For using the RoutingExtension
- symfony/security: For using the SecurityExtension
- symfony/stopwatch: For using the StopwatchExtension
- symfony/templating: For using the TwigEngine
- symfony/translation: For using the TranslationExtension
- symfony/var-dumper: For using the DumpExtension
- symfony/yaml: For using the YamlExtension
This package is auto-updated.
Last update: 2024-09-28 06:36:20 UTC
README
积分管理系统
安装
通过composer安装
php -d memory_limit=-1 composer.phar require atm/pointsbundle
在您的AppKernel中
public function registerbundles()
{
return [
...
...
new ATM\PointsBundle\ATMPointsBundle(),
];
}
路由
追加到主路由文件
# app/config/routing.yml
atm_points:
resource: "@ATMPointsBundle/Resources/config/routing.yml"
prefix: /
配置示例
以下显示默认值
# app/config/config.yml
atm_points:
class:
model:
point: Your Points class Namespace
user: Your User class Namespace
image_gallery: Your ImageGallery class Namespace
video: Your Video class Namespace
user_point_role: User role that is going to have points for example: 'ROLE_USER'
gallery_points: Amount of points
video_points: Amount of points
description_points: Amount of points
profile_image_points: Amount of points
header_image_points: Amount of points
类的继承
为了使用ATMPointsBundle的类,您需要创建自己的Points类,该类将从以下所示ATMPointsBundle的Points类扩展
namespace CoreBundle\Entity;
use ATM\PointsBundle\Entity\Point as BasePoint;
class Point extends BasePoint{
public function __construct(){
parent::__construct();
}
}
Twig扩展
您可以使用以下twig扩展来了解用户有多少积分
{{ getAtmUserPoints(user.id) }}