[TYPO3-english] Instantiate controller in eID

Jigal van Hemert jigal.van.hemert at typo3.org
Tue Jun 3 11:21:42 CEST 2014


Hi,

On 3-6-2014 10:29, Iban wrote:
> In that function, I'd like to instantiate a model class, insert data in
> the database and send an email.
>
> Can I do that with an eID?

I agree with Markus. eID was meant for situations where you don't need 
to have all the features of TYPO3 and where a fast and simple 
initialization was all you needed.

Think of features like an autocomplete on a form field.

In an eID script you need to initialize a lot yourself (database 
connection must be explicitly activated, frontend user must be 
explicitly initialized, etcetera).
You could do all the bootstrap functionality yourself in an eID script, 
(which is quite complicated and can easily go wrong) but then there is 
not really an point to using an eID script.

If you need all the normal functionality of TYPO3 to render content, 
access control, user sessions,... then it's easier to configure an extra 
page object with a type number of your choice. Configure the page object 
to only render content (without the rest of the page structure) or 
return some json data and you can use it in an ajax request (use type=xx 
in the URL to trigger your page object).

TypoScript page object:
http://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Page/Index.html
TypoScript page.config.disableAllHeadercode:
http://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#disableallheadercode

-- 
Jigal van Hemert
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-english mailing list