SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
Starting with ExtBase
Grundaufbau ExtBase/Fluid
Model: Product
• Title
• Price
Repository
• findAll
• findByProperty

Controller
• List
• Show
Fluid Template
• List

Fluid Template
• Show
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>
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);
}

}
Extension Builder
Extension Builder
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
Verzeichnisstruktur
- Classes
--- Controller
--- Domain
--- ViewHelpers
- Configuration
--- FlexForms
--- TCA
--- TypoScript
- Resources
--- Private
----- Templates
--- Public
----CSS
----JS
Konventionen
• phpDoc vor Funktionen
• Camel-Case, Lower-Camel-Case,
Unterstrich,…?
– Class: AsDemoExtbase
– Variable: asDemoExtbase
– Datenbank: as_demo_extbase
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 ….“)
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!
Nice to know
• piBased: $this->pi_getLL('languagekey')
• TYPO3CMSExtbaseUtilityLocalizationUtility::tr
anslate('languagekey', $extensionName)
(extensionName: Ordnername in typo3conf/ext)
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

Contenu connexe

Tendances

Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & ReasonType Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & ReasonNikolaus Graf
 
RichFaces: more concepts and features
RichFaces: more concepts and featuresRichFaces: more concepts and features
RichFaces: more concepts and featuresMax Katz
 
Web development today
Web development todayWeb development today
Web development todayHesham Amin
 
Ch2(working with forms)
Ch2(working with forms)Ch2(working with forms)
Ch2(working with forms)Chhom Karath
 
JavaScript徹底整理セミナー "今から始める人も、整理したい人も"
JavaScript徹底整理セミナー "今から始める人も、整理したい人も"JavaScript徹底整理セミナー "今から始める人も、整理したい人も"
JavaScript徹底整理セミナー "今から始める人も、整理したい人も"CASAREAL, Inc.
 
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 DatasourceKaz Watanabe
 
Using Actions and Filters in WordPress to Make a Plugin Your Own
Using Actions and Filters in WordPress to Make a Plugin Your OwnUsing Actions and Filters in WordPress to Make a Plugin Your Own
Using Actions and Filters in WordPress to Make a Plugin Your OwnBrian Hogg
 
COMP2021 Final Project - LightHTML
COMP2021 Final Project - LightHTMLCOMP2021 Final Project - LightHTML
COMP2021 Final Project - LightHTMLConrad Lo
 
Яків Крамаренко “Локатори і з чим їх їдять:)”
Яків Крамаренко “Локатори і з чим їх їдять:)”Яків Крамаренко “Локатори і з чим їх їдять:)”
Яків Крамаренко “Локатори і з чим їх їдять:)”Dakiry
 
Introduction to RichFaces
Introduction to RichFacesIntroduction to RichFaces
Introduction to RichFacesMax Katz
 
Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using CodeceptionJeroen van Dijk
 
Mysql Aggregate
Mysql AggregateMysql Aggregate
Mysql Aggregatelotlot
 
정오의 데이트 for iOS 코드 정리
정오의 데이트 for iOS 코드 정리정오의 데이트 for iOS 코드 정리
정오의 데이트 for iOS 코드 정리태준 김
 
PHP Array very Easy Demo
PHP Array very Easy DemoPHP Array very Easy Demo
PHP Array very Easy DemoSalman Memon
 

Tendances (20)

Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & ReasonType Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
 
7. Lower upper in Laravel
7. Lower upper in Laravel7. Lower upper in Laravel
7. Lower upper in Laravel
 
RichFaces: more concepts and features
RichFaces: more concepts and featuresRichFaces: more concepts and features
RichFaces: more concepts and features
 
Keeping It Simple
Keeping It SimpleKeeping It Simple
Keeping It Simple
 
Web development today
Web development todayWeb development today
Web development today
 
Ch2(working with forms)
Ch2(working with forms)Ch2(working with forms)
Ch2(working with forms)
 
JavaScript徹底整理セミナー "今から始める人も、整理したい人も"
JavaScript徹底整理セミナー "今から始める人も、整理したい人も"JavaScript徹底整理セミナー "今から始める人も、整理したい人も"
JavaScript徹底整理セミナー "今から始める人も、整理したい人も"
 
8.1
8.18.1
8.1
 
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource
 
Using Actions and Filters in WordPress to Make a Plugin Your Own
Using Actions and Filters in WordPress to Make a Plugin Your OwnUsing Actions and Filters in WordPress to Make a Plugin Your Own
Using Actions and Filters in WordPress to Make a Plugin Your Own
 
COMP2021 Final Project - LightHTML
COMP2021 Final Project - LightHTMLCOMP2021 Final Project - LightHTML
COMP2021 Final Project - LightHTML
 
Jquery ajax & form
Jquery ajax & formJquery ajax & form
Jquery ajax & form
 
Laravel the right way
Laravel   the right wayLaravel   the right way
Laravel the right way
 
Яків Крамаренко “Локатори і з чим їх їдять:)”
Яків Крамаренко “Локатори і з чим їх їдять:)”Яків Крамаренко “Локатори і з чим їх їдять:)”
Яків Крамаренко “Локатори і з чим їх їдять:)”
 
Introduction to RichFaces
Introduction to RichFacesIntroduction to RichFaces
Introduction to RichFaces
 
Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using Codeception
 
Mysql Aggregate
Mysql AggregateMysql Aggregate
Mysql Aggregate
 
정오의 데이트 for iOS 코드 정리
정오의 데이트 for iOS 코드 정리정오의 데이트 for iOS 코드 정리
정오의 데이트 for iOS 코드 정리
 
PHP Array very Easy Demo
PHP Array very Easy DemoPHP Array very Easy Demo
PHP Array very Easy Demo
 
Feeds drupal cafe
Feeds drupal cafeFeeds drupal cafe
Feeds drupal cafe
 

Similaire à Getting started with ExtBase

Frameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHPFrameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHPDan Jesus
 
Creating web api and consuming part 2
Creating web api and consuming part 2Creating web api and consuming part 2
Creating web api and consuming part 2Dipendra Shekhawat
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to ProductionMark Baker
 
Modularity and Layered Data Model
Modularity and Layered Data ModelModularity and Layered Data Model
Modularity and Layered Data ModelAttila Jenei
 
Oop php 5
Oop php 5Oop php 5
Oop php 5phpubl
 
Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02Revath S Kumar
 
Single Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsSingle Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsPrateek Dayal
 
How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF Luc Bors
 
Synapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindiaComplaints
 
Implement rich snippets in your webshop
Implement rich snippets in your webshopImplement rich snippets in your webshop
Implement rich snippets in your webshopArjen Miedema
 
Session six ASP.net (MVC) View
Session six ASP.net (MVC) ViewSession six ASP.net (MVC) View
Session six ASP.net (MVC) ViewMustafa Saeed
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel.NET Conf UY
 
cake phptutorial
cake phptutorialcake phptutorial
cake phptutorialice27
 
F# in the enterprise
F# in the enterpriseF# in the enterprise
F# in the enterprise7sharp9
 

Similaire à Getting started with ExtBase (20)

Frameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHPFrameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHP
 
Creating web api and consuming part 2
Creating web api and consuming part 2Creating web api and consuming part 2
Creating web api and consuming part 2
 
Practica n° 7
Practica n° 7Practica n° 7
Practica n° 7
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to Production
 
Modularity and Layered Data Model
Modularity and Layered Data ModelModularity and Layered Data Model
Modularity and Layered Data Model
 
Oop php 5
Oop php 5Oop php 5
Oop php 5
 
Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02
 
Single Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsSingle Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and Rails
 
How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF
 
Synapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephp
 
Backbone - TDC 2011 Floripa
Backbone - TDC 2011 FloripaBackbone - TDC 2011 Floripa
Backbone - TDC 2011 Floripa
 
Django crush course
Django crush course Django crush course
Django crush course
 
Implement rich snippets in your webshop
Implement rich snippets in your webshopImplement rich snippets in your webshop
Implement rich snippets in your webshop
 
Session six ASP.net (MVC) View
Session six ASP.net (MVC) ViewSession six ASP.net (MVC) View
Session six ASP.net (MVC) View
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Bioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperlBioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperl
 
cake phptutorial
cake phptutorialcake phptutorial
cake phptutorial
 
How te bring common UI patterns to ADF
How te bring common UI patterns to ADFHow te bring common UI patterns to ADF
How te bring common UI patterns to ADF
 
F# in the enterprise
F# in the enterpriseF# in the enterprise
F# in the enterprise
 

Dernier

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Getting started with ExtBase

  • 2. Grundaufbau ExtBase/Fluid Model: Product • Title • Price Repository • findAll • findByProperty Controller • List • Show Fluid Template • List Fluid Template • Show
  • 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. 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); } }
  • 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. Verzeichnisstruktur - Classes --- Controller --- Domain --- ViewHelpers - Configuration --- FlexForms --- TCA --- TypoScript - Resources --- Private ----- Templates --- Public ----CSS ----JS
  • 9. Konventionen • phpDoc vor Funktionen • Camel-Case, Lower-Camel-Case, Unterstrich,…? – Class: AsDemoExtbase – Variable: asDemoExtbase – Datenbank: as_demo_extbase
  • 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. 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. Nice to know • piBased: $this->pi_getLL('languagekey') • TYPO3CMSExtbaseUtilityLocalizationUtility::tr anslate('languagekey', $extensionName) (extensionName: Ordnername in typo3conf/ext)
  • 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