drago-ex/project-user 问题修复 & 功能扩展

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

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

drago-ex/project-user

最新稳定版本:v1.0.2

Composer 安装命令:

composer require drago-ex/project-user

包简介

A small helper package for working with the authenticated user in Drago project.

README 文档

README

A small helper package for working with the authenticated user in Drago project. Provides type-safe access to identity data and a simple, extensible user identity object.

License: MIT PHP version Coding Style

Requirements

  • PHP >= 8.3
  • Nette Framework
  • Drago Project core packages

Installation

composer require drago-ex/project-user

Examples

Injecting the user service:

use App\Core\User\UserAccess;
use Nette\DI\Attributes\Inject;

final class SomePresenter extends Presenter
{
	#[Inject]
	public UserAccess $userAccess;

	protected function beforeRender(): void
	{
		parent::beforeRender();
		$this->template->userAccess = $this->userAccess;
	}
}

Identity data in latte

{varType App\Core\User\UserAccess $userAccess}
{block content}
	<p>{$userAccess->getUserIdentity()->username}</p>
{/block}

User identity object

For common identity fields, use the typed UserIdentity object:

$identity = $userAccess->getUserIdentity();

echo $identity->username;
echo $identity->email;

The UserIdentity class is intentionally simple and can be extended with additional attributes (e.g. id, roles, permissions) as needed.

UserIdentityException is thrown when identity data is missing or invalid.

Notes

  • This package does not handle authentication or authorization.
  • Focused only on safe and convenient access to user identity data.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-25