extbase

How can I use an injected object in the constructor?

可紊 提交于 2019-12-06 09:03:19
I have a service class in my Extbase extension and want to use the ObjectManager to create an instance of an object in the constructor. /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface * @inject */ protected $objectManager; public function __construct() { $this->standaloneView = $this->objectManager->get('TYPO3\CMS\Fluid\View\StandaloneView'); $this->standaloneView->setFormat('html'); } Unfortunately this doesn't fails with an error Call to a member function get() on null because the injected class doesn't seem to be available in the constructor. How can I use an injected class in

how to include public resources to typo3 extbase extension

邮差的信 提交于 2019-12-06 06:49:16
I'm building an extension that creates a backend module that enables be_users to resize images. I'm trying to add / include css and javascript files by using the pageRenderer but the files are never included I can only apply css if add it directly in the fluid Template using a style tag and include the javascript file with a script tag. I tried something like this in the controller protected $pageRenderer; .... $this->pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Page\\PageRenderer'); $this->pageRenderer->addCssFile('/typo3conf/ext/extKey/Resources

“Map to existing tables” in Extension builder showing weird issues in TYPO3

怎甘沉沦 提交于 2019-12-06 02:55:31
问题 In my extension MyExt , I mapped the model Page to pages table in TYPO3. Firstly it shows me the type mismatch error, I anyhow went ahead and saved it. The following things happen: My Page tree becomes like this: My New Record Form shows only the UIDs and not the titles: My Page Edit becomes like this: In my MyExt/Configuration/TypoScript/setup.txt I have this: config.tx_extbase.persistence.classes { Tx_MyExt_Domain_Model_Page { mapping { tableName = pages } } } Is this a bug ? Or something i

Extend TYPO3 femanager

你说的曾经没有我的故事 提交于 2019-12-06 02:30:21
Does anyone have a working example how to extend femanager 3.3.0 on TYPO3 8.7? I created a new Extension which does all the stuff (new database fields for fe_user, TCA, Partials,....). I have the new fields in the femanager plugin and can select them for the frontend. Registering IS WORKING: the new fields are saved in the database. There is a Warning in the Log: Core: Error handler (FE): PHP Warning: Declaration of TOCO3\TocoLedes\Controller\NewController::createAction(TOCO3\TocoLedes\Domain\Model\User $user) should be compatible with In2code\Femanager\Controller\NewController::createAction

Typo3: How to upload a file and create a file reference?

ぃ、小莉子 提交于 2019-12-06 01:24:50
i'll try to upload a file (or later multiple files) in FE. This works, like my current code. But how can i get a file reference of this file now? /** * * @var array $fileData * @var integer $feUserId * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference */ private function uploadFile($fileData, $feUserId) { $storageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\StorageRepository'); $storage = $storageRepository->findByUid(1); # Fileadmin = 1 $saveFolder = $storage->getFolder($this->settings['uploadFolder']); // Datei speichern $fileObject =

Add/Create Element to ObjectStorage using Javascript in Extbase/Fluid TYPO3

狂风中的少年 提交于 2019-12-06 00:39:23
what is the correct way to dynamically create new Child Elements in a Fluid Form using JavaScript? Problem: 1:n Relation (Parent/Child) using Extbase ObjectStorages: When the Parent Fluid Form is called it should be possible to add several childs (incl. properties of course!) Dirty, partly working, Solution: I added some JS Code and added the required input elements dynamically. The "xxx" will be interated for each Child. The data will be correctly stored in the DB. <input type="text" placeholder="First Name" name="tx_booking[newBooking][accompanyingperson][xxx][firstname]"> However, if an

TYPO3 Extbase backend module. Template path issue

蹲街弑〆低调 提交于 2019-12-05 21:37:57
I'm experiencing a strange problem with extbase/fluid extension creation. I use TYPO3 6.1 I've made an extension with a backend module on my dev server (same configuration/hardware then the prod). The module works perfectly with the path to the template : myext/Resources/Private/Backend/Templates myext/Resources/Private/Backend/Layouts myext/Resources/Private/Backend/Partials After this, I downloaded my extension's zip in the ext manager and then installer on the prod server. Now I can't use my extension because the module don't find the templates. I've configured the extension by the same way

How to add Tooltips to a Flexform Plugin Configuration?

天涯浪子 提交于 2019-12-05 11:32:19
I guess its quite Simple as soon as you know it once, but I am searching on this Topic now for 4+ Hours. So maybe someone can help me out, with a push to the right direction. I develop an Extension for TYPO3 6.2 with Extbase. The Plugin Configuration is done with a FlexForm. To increase Usabillity I want to add Tooltips (helptexts or CSH) to my FlexForm. Approach 1: I tryed it with the Tag <cshFile> and adding the corresponding XML to the Extension Files. As many Forums and Blogs suggest, this is deprecated, so I tought lets try the other Approach. Approach 2: Adding the "locallang_csh

TYPO3 tutorial extension, controller does not exist

时间秒杀一切 提交于 2019-12-05 10:42:10
I'm trying to get started with TYPO3 extensions and was following this tutorial to get to see the basics. In the backend everything works fine, but on the front end I get an error: Oops, an error occurred! Code: 20170209104827c3b58d58 - {"exception":"exception 'ReflectionException' with message 'Class Tx_Inventory_Controller_InventoryController does not exist' My files are exactly the same as in the tutorial. I have no idea what is causing this. I assume I made some dumb mistake with namespaces, but they seem to be all correct. The controller class can be found below and is located in

Execute repository functions in scheduler task

让人想犯罪 __ 提交于 2019-12-05 07:19:38
Currently I have an scheduler task, but I want to use function from my extbase repository (in the same extension). I keep getting "PHP Fatal error: Call to a member function add() on a non-object", no matter how I try to include my repo or controller from extbase. My SampleTask.php: namespace TYPO3\ExtName\Task; class SampleTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask { public function execute() { $controller = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\ExtName\Controller\SampleController'); $new = new \TYPO3\ExtName\Domain\Model\Sample; $new->setName('test');