panlatent/craft-annotations

This package is abandoned and no longer maintained. The author suggests using the panlatent/craft-attribute package instead.

dev-main 2025-03-15 07:00 UTC

This package is auto-updated.

Last update: 2025-03-15 07:13:13 UTC


README

Craft Annotations aims to use PHP annotation features to bring a new development experience to CraftCMS and Yii Framework.

⚠️ This project has been transferred to another repository Craft Attribute.

Notice: This library is experimental and there will undoubtedly be some performance impact (but probably minimal) from using it, as parsing annotations requires leveraging the reflection API.

Craft Annotations are not intrusive. It uses inheritance to implement functionality. Use it on demand or as a middle layer between your application and Craft/Yii.

Features

  • Controller Access Control

Requirements

  • PHP 8.0.2 or later.

Installation

Then tell Composer to load the library

composer require panlatent/craft-annotations

Usages

Documentation

Attribute Targets Scopes Supports
#[AllowAnonymous] Controller Class Craft Yii
#[RequireLogin] ControllerAction Method Craft
#[RequirePostRequest] ControllerAction Method Craft
#[RequireAcceptsJson] ControllerAction Method Craft

License

The Element Messages is open-sourced software licensed under the MIT license.