castiron/typo3-extbaseinstantiable 问题修复 & 功能扩展

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

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

castiron/typo3-extbaseinstantiable

Composer 安装命令:

composer require castiron/typo3-extbaseinstantiable

包简介

Small easy extbase object instantiation

README 文档

README

This package provides a mixin (read: trait) that lets you bestow the power of self-instantiation (using TYPO3 conventional mechanisms) to your classes. Add this mixin to any class to make it instantiable using the Extbase ObjectManager with ease.

Interface

Once you've mixed the trait into your class, you can call MyClass::get() to get an instance of the class.

Detailed usage

/**
 * Class MyClass
 */
class MyClass
{
    use \Castiron\ExtbaseInstantiable\Traits\ExtbaseInstantiable;

    /**
     * Some public interface
     */
    public function execute()
    {
        // yadda yadda whatever
    }
}

/**
 * Instantiate (with ObjectManager) and call a public method.
 */
MyClass::get()->execute();

Why do I want this?

A couple of reasons why this is handy:

  • It makes instantiating your class in TYPO3-world easy-peasy (vs GeneralUtility::makeInstance or ObjectManager::get called directly)
  • It uses ObjectManager::get under the hood, so automatic dependency injection works if you use annotations like @inject

FAQ

Will it also respect marker interfaces like SingletonInterface?

Yes! It's using normal TYPO3 object instantiation under the hood, so all that weirdo magic will work.

Installation

composer require castiron/typo3-extbaseinstantiable

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固