Starting with ExtBase
Grundaufbau ExtBase/Fluid
Model: Product
• Title
• Price
Repository
• findAll
• findByProperty

Controller
• List
• Show
F...
Grundaufbau ExtBase/Fluid
Model

Controller

Fluid Template

public function getTitle() {
return $this->title;
}
public fu...
ViewHelper
{namespace as=TYPO3AsViewhelperViewHelpers}

Fluid Template
<f:for each="{products}" as="product">
<tr>
<td>
<f...
Extension Builder
Extension Builder
Extension Builder: Relations
•
•
•
•

Hauptobjekt: Product – aggregate root
Untertabellen: Color
Relations: Drag & Drop mi...
Verzeichnisstruktur
- Classes
--- Controller
--- Domain
--- ViewHelpers
- Configuration
--- FlexForms
--- TCA
--- TypoScri...
Konventionen
• phpDoc vor Funktionen
• Camel-Case, Lower-Camel-Case,
Unterstrich,…?
– Class: AsDemoExtbase
– Variable: asD...
Datenbank: Repository
• Sehr viele Default-Funktionen:
• findAll = SELECT * FROM table
• findByName($val) =
SELECT * FROM ...
ObjectManager
• PHP: new
TYPO3: t3lib_div::createInstance
• Extbase: Singleton, DependencyInjection
• objectManager->get (...
Nice to know
• piBased: $this->pi_getLL('languagekey')
• TYPO3CMSExtbaseUtilityLocalizationUtility::tr
anslate('languageke...
Links
• Tutorial: http://www.typo3lexikon.de/typo3tutorials/extensions/fluid.html
• Extbase Buch Kurfürst:
http://docs.typ...
Upcoming SlideShare
Loading in...5
×

Getting started with ExtBase

1,494

Published on

ExtBase starting tutorial from TYPO3 camp Regensburg #t3cr

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,494
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Getting started with ExtBase

  1. 1. Starting with ExtBase
  2. 2. Grundaufbau ExtBase/Fluid Model: Product • Title • Price Repository • findAll • findByProperty Controller • List • Show Fluid Template • List Fluid Template • Show
  3. 3. Grundaufbau ExtBase/Fluid Model Controller Fluid Template public function getTitle() { return $this->title; } public function listAction() { $products = $this->productRepository->findAll(); $this->view->assign('products', $products); } <f:for each="{products}" as="product"> <tr> <td> <f:link.action action="show" arguments="{product : product}"> {product.title} </f:link.action> </td> </tr> </f:for>
  4. 4. ViewHelper {namespace as=TYPO3AsViewhelperViewHelpers} Fluid Template <f:for each="{products}" as="product"> <tr> <td> <f:link.action action="show" arguments="{product : product}"> <as:uppercase value="{product.title}" /> </f:link.action> </td> </tr> </f:for> ViewHelper class UppercaseViewHelper extends TYPO3CMSFluidCoreViewHelperAbstractViewHelper { public function render($value) { return strtoupper($value); } }
  5. 5. Extension Builder
  6. 6. Extension Builder
  7. 7. Extension Builder: Relations • • • • Hauptobjekt: Product – aggregate root Untertabellen: Color Relations: Drag & Drop mit dem Kreis More->Type: 1:1, 1:n, n:1, n:m
  8. 8. Verzeichnisstruktur - Classes --- Controller --- Domain --- ViewHelpers - Configuration --- FlexForms --- TCA --- TypoScript - Resources --- Private ----- Templates --- Public ----CSS ----JS
  9. 9. Konventionen • phpDoc vor Funktionen • Camel-Case, Lower-Camel-Case, Unterstrich,…? – Class: AsDemoExtbase – Variable: asDemoExtbase – Datenbank: as_demo_extbase
  10. 10. Datenbank: Repository • Sehr viele Default-Funktionen: • findAll = SELECT * FROM table • findByName($val) = SELECT * FROM table where name like „$val • findOneByArticleNo($id) SELECT … limit 1 • Add, remove, update, replace, • $query->createQuery; $query->matching(), constraints, $query->execute • SQL: $query->statement(„SELECT ….“)
  11. 11. ObjectManager • PHP: new TYPO3: t3lib_div::createInstance • Extbase: Singleton, DependencyInjection • objectManager->get (Controller, Repository) • objectManager->create (Model), danach im Repistory: $this->add($obj) $prod=$this->objectManager->create ('TYPO3Asextbasedemo1DomainModelProduct'); $prod->setTitle("AutoCreated"); $this->productRepository->add($prod); 2 Slashes in Namespace Path!
  12. 12. Nice to know • piBased: $this->pi_getLL('languagekey') • TYPO3CMSExtbaseUtilityLocalizationUtility::tr anslate('languagekey', $extensionName) (extensionName: Ordnername in typo3conf/ext)
  13. 13. Links • Tutorial: http://www.typo3lexikon.de/typo3tutorials/extensions/fluid.html • Extbase Buch Kurfürst: http://docs.typo3.org/typo3cms/ExtbaseFluidBook/ • Mittwald: ExtBase Referenz PDF https://www.mittwald.de/typo3-dokumentation/ • Tips: http://t3n.de/magazin/zehn-tipps-tricks-extbasefluid-227639/ • Namespaces: http://www.speedprogs.de/anleitungen/detailansicht/ extension-entwicklung-mit-namespaces.html
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×