简体   繁体   中英

TYPO3 TCA fill in a field with the year of creation and the UID

I have created a new field in the TCA. This is now empty. Now I would like to fill this in with the creation year and the current UID when creating the data record or afterwards.

Do I have to do this via hooks or tasks?

As the uid of a new record is unknown until the record is saved there could not be a prefill.

Of course you could create a scheduler task to set a field with the value from the creation date (field cr_date ) and uid regulary.

But a better solution would be a hook after the record creation as it would be less overhead.


On the other side: as the relevant data already is stored in every record ( cr_date and uid ):
do you realy need another field with the same information?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM