Extbase
From TYPO3Wiki
| Teams R&D-Committee | This page belongs to Core Team (Members|Contact). see our current activities |
| Current development and maintenance of the TYPO3 core is our mission. | |
Contents |
EXT:extbase - pibase 2.0
pibase is getting old now and we'd like to code plugins and modules in a more sophisticated - object oriented way. This is where extbase joins the game (the core game in this case). Extbase is going to be a system extension and provide classes to easily work with core functions when developing extensions and modules. Such classes will cover working with Templates, FE users, Links, Caching, Flexforms, ...
This page is a place to collect ideas about the classes we need and how they should look like.
Concepts
- allow use of Patterns like MVC / ORM (tcaobject)
- transparent API (Facades) for diffrent TYPO3 specific stuff (workspace / feediting / translations)
Classes
The following is a first list of classes we think are usefull for extension development
Option
(Isn't a better name Configuration?) Handling of
- Default settings
- Options set through TS
- Options set through Flexforms
- Unified interface
Form
- low level generation of formelements (selectboxes etc)
MVC
Idea is to fit two goals
- Set of small PHP5 based basis abstract classes that can be used as a start for own individual MVC based extensions.
- Some predefined models/view and low level classes that can be used for common requirements (like having a list view)
So the 3 Basis classes can be:
- ConrollerAbstract (just gets a Configuration Object. a main method decides which action to call)
- ModelBaseAbstract (dont really need much (just a setConfiguration ...))
- ViewBaseAbstract (two methods: setModel / render )
Views that fills the render method with live:
- MarkerViewBase
- SmartyViewBase
How a action can look like:
// 1) do some buissness logic with your extension
...
//2) Output prepartion with MVC
$model=t3lib_div::makeInstance('mySpecialModel');
//initialise model data
$model->load(...)
...
$view=t3lib_div::makeInstance('mySpecialView');
$view->setModel($model);
$view->setTemplate($this->getConfiguration()['template']);
return $view->render();
Pro: I am free with designing my own models and view -> I just have a basis to use.
Model and View for Lists
(to be inspired by FLOW3 MVC Framework)
GUI
- ListModel (simple ArrayObject to append listentries)
- ListView (simple view that renders a ListModel (with pagination etc)
useful Models
- TableListAbstract (functions to load a data from a table, support for overlays, workspaces etc)
- TableListToListConnector
FeUser
handling of all things related to FE users
FeUserGroup
handling of all things related to FE user groups
Cache
- easy cache handling
Template
- easy templating
- ###LLL:some.label.key### should be replaced with a label automatically
- ###RECORD:my_variable_coming_from_db_and_processed_through_a_plugin### or ###VAR:some_variable###
- Loops: ###LOOP:SOME_SUBPART### Start, ###LOOP:SOME_SUBPART### End (in HTML comments like subparts)
Feed
- easy creation of feeds with different formats
- should use the abstract factory pattern
Link
Can be taken from lib extension: Is a very good abstraction for typolink.
Registry
A Registry class (using Registry and Singleton Pattern) to transfer Objects between the different layers of MVC or even different plugin instances.
Table
Easyly create a HTML table (optionally with paging and sorting). Instanciate a HtmlTable object, add some headers, add data rows, call the render method, be done with it.
