eye4web / zfc-user-profile-picture
为 ZfcUser 添加个人头像功能。
0.0.1
2015-03-07 22:05 UTC
Requires
- php: ~5.4
- zf-commons/zfc-user: ~1.2
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: ~4.0.0
- squizlabs/php_codesniffer: ~2.0.0@DEV
This package is not auto-updated.
Last update: 2024-09-14 16:13:38 UTC
README
介绍
本模块为 ZfcUser 添加了个人头像上传功能。
安装
使用 composer
-
将此项目添加到 composer.json 文件中
"require": { "eye4web/zfc-user-profile-picture": "dev-master" }
-
现在运行以下命令让 composer 下载模块
$ php composer.phar update
-
在您的
application.config.php
文件中启用它。<?php return array( 'modules' => array( // ... 'Eye4web\ZfcUser\ProfilePicture' ), // ... );
-
将
config/eye4web.zfcuser.profilepicture.global.php.dist
复制到config/autoload/eye4web.zfcuser.profilepicture.global.php
并根据您的需求进行配置。 -
确保您的用户实体实现了
Eye4web\ZfcUser\ProfilePicture\Entity\ProfilePictureInterface
接口。use Eye4web\ZfcUser\ProfilePicture\Entity\ProfilePictureInterface; use ZfcUser\Entity\UserInterface; class User implements ProfilePictureInterface, UserInterface { // ... protected $profile_picture; public function getProfilePicture() { return $this->profile_picture; } public function setProfilePicture($path) { $this->profile_picture = $path; } }
-
确保您已安装 libmagic 和 fileinfo php 扩展。