[Typo3-dev] Proposing hook for class.tslib_content.php

dan frost dan at danfrost.co.uk
Wed Sep 15 18:37:59 CEST 2004


> 
>     // Object TypoScript hook:
> if(t3lib_extMgm::isLoaded('obts')...
> 
> I suggest generalizing that.
> 
> I prefer the way Jan has proposed (using the "default" of the switch) to 
> the way Kasper has implemented the ObTS hook anyway.
> 
> cheers,
> Ingmar

I was about to say the same.

I suggest using ObTS and its library system to allow lots of different 
types of class to pick-up the datatype.

However, there can be the problem that something like:

page = PAGE
page.10 = some text... oh, i just put it in

..won't work because "some text... oh, i just put it in" is tested for 
being a datatype. This is true in ObTS 1.1.2 (current version) but i 
will try to make it allow "some text... oh, i just put it in" through as 
plain text in version 1.1.x (!)

By the way, the reason i want to use the library system in ObTS (dlib) 
is that it allows over-ride of over-rides! For example, extension A 
contains class "mynewclass". Extesnion B overrides (like XCLASS) this 
class. Extension C also overrides it.

With XCLASSes it is impossible to know about hte overrides at run-time - 
and impossible to do anything about it. With libraryManager (EXT:dlib) 
you can expressly ask for overriden classes. libraryManager also acts as 
a singleton/object-factor system.

What kind of API should the hook expect. Just:

class tx_someClass {
   var $output;

   function init($conf, $data, $cObj) {
      // make $this->output;
   }

   function render() {
     return $this->output;
   }
}

Would fit and work.

Dan




More information about the TYPO3-dev mailing list