lochmueller/autoloader

自动加载 ExtBase 扩展的组件,以便在公司的咖啡时间有更多时间 ;)。这个扩展不是 PHP SPL 自动加载器或类加载器 - 它更好!加载 CommandController、Xclass、Hooks、FlexForms、Slots、TypoScript、TypeConverter、BackendLayouts,并负责创建所需的内容

安装次数: 303,579

依赖项: 6

建议者: 0

安全性: 0

星标: 20

关注者: 6

分支: 30

开放问题: 0

类型:typo3-cms-extension

7.4.6 2023-05-11 07:59 UTC

README

Latest Stable Version Total Downloads License TYPO3 TYPO3 Average time to resolve an issue Percentage of issues still open

自动加载:开发者的瑞士军刀

自动加载可以加快您的开发周期 - 更多时间享用咖啡!

自动加载注解

/**

* @DatabaseTable(tableName="")
* @DatabaseKey([key=""|argumentName=""])
* @DatabaseField(type=""[, sql=""])
*
* @EnableRichText([value=""|argumentName=""])
* @Hook(locations={})
* @NoCache([value=""|argumentName=""])
* @NoHeader([value=""|argumentName=""])
* @ParentClass(parentClass="")
* @Plugin([value=""|argumentName=""])
* @RecordType(recordType="")

* @SignalClass([value=""|argumentName=""])
* @SignalName([value=""|argumentName=""])
* @SignalPriority([value=""|argumentName=""])

* @SmartExclude(excludes="{}")
* @WizardTab(config="")
*
*/

工作示例

我们将示例放入 EXT:autoloader。请检查其他使用自动加载的扩展作为示例(EXT:calendarize)

智能对象示例(仅其中一个功能)

ext_tables.php

\HDNET\Autoloader\Loader::extTables(
    'vendorName',
    'extensionKey',
    [
    	'SmartObjects',
    	'TcaFiles'
    ]
);

ext_localconf.php

\HDNET\Autoloader\Loader::extLocalconf(
	'vendorName',
	'extensionKey'
	[
		'SmartObjects',
		'TcaFiles'
	]
);

Test.php

namespace vendorName\extensionKey\Domain\Model;

use HDNET\Autoloader\Annotation\DatabaseField;
use HDNET\Autoloader\Annotation\DatabaseTable;

use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/**
 * Create a test-table for this model with this annotation.
 * @DatabaseTable(tableName="test")
 */
class Test extends AbstractEntity {

	/**
	 * A basic field
	 *
	 * @var string
	 * @DatabaseField(type="string")
	 */
	protected $textField;

	/**
	 * A boolean field
	 *
	 * @var bool
	 * @DatabaseField(type="bool")
	 */
	protected $boolField;

	/**
	 * File example
	 *
	 * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
	 * @DatabaseField(type="string")
	 */
	protected $file;

	/**
	 * Custom (variable that has a custom DB type)
	 *
	 * @var int
	 * @DatabaseField(type="int", sql="int(11) DEFAULT '0' NOT NULL")
	 */
	protected $customField;

	// add here some Getters and Setters
}

文档