SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Joomla!
               Components
                        (Uma Visão Geral)



René Muniz
Desenvolvedor Joomla!
Fábrica Livre
Por que?
Conceitos

• PHP (Doh!)
• OOP (Programação Orientada a Objetos)
• MVC (Model-View-Controller)
• Joomla! Framework
Programação Orientada
   a Objetos (OOP)
Objeto
class StarFighter
  {
              public $size;
              public $color;
              public $wings;
              public $droid;
              public $guns = array();

             function accelerate() {
                 /* Procedure to accelerate here */
             }

             function shoot() {
                 /* Procedure to shoot something here */
             }
  }

  $XWing         = new StarFighter();
  $XWing->size   = "2.2 metters";
  $XWing->color
 = "#FFFFFF";
  $XWing->wings
 = "4";
  $XWing->droid
 = "1";
  $XWing->guns
  = array("regular" => 4, "bomb" => 1);




Classe StarFighter
Model-View-Controller
Modelo == Objeto
View == Interface
Controller == Regras
Joomla! Framework
Joomla!
Joomla’s API   (http://api.joomla.org)

JFactory, JRoute, JText, JVersion, JApplication, JApplicationHelper, JComponentHelper, JController, JMenu,
JModel, JModuleHelper, JPathway, JRouter, JView, JObject, JObservable, JObserver, JTree, JNode, JCache,
JCacheCallback, JCacheOutput, JCachePage, JCacheStorage, JCacheStorageApc, JCacheStorageEaccelerator,
JCacheStorageFile, JCacheStorageMemcache, JCacheStorageXCache, JCacheView, JClientHelper, JFTP,
JLDAP, JDatabase, JDatabaseMySQL, JDatabaseMySQLi, JRecordSet, JTable, JTableARO, JTableAROGroup,
JTableCategory, JTableComponent, JTableContent, JTableMenu, JTableMenuTypes, JTableModule,
JTablePlugin, JTableSection, JTableSession, JTableUser, JDocument, JDocumentError, JDocumentFeed,
JDocumentHTML, 
 JDocumentPDF, JDocumentRaw, JDocumentRenderer, JDocumentRendererAtom,
JDocumentRendererComponent, JDocumentRendererHead, 
 J D o c u m e n t R e n d e r e r M e s s a g e ,
JDocumentRendererModule, JDocumentRendererModules, JDocumentRendererRSS, JBrowser, JRequest,
JResponse, JURI, JError, JException, JLog, JProfiler, JDispatcher, JEvent, JArchive, JArchiveBzip2, JArchiveGzip,
JArchiveTar, JArchiveZip, JFile, JFolder, JPath, JFilterInput, JFilterOutput, JButton, JButtonConfirm,
JButtonCustom, JButtonHelp, JButtonLink, JButtonPopup, JButtonSeparator, JButtonStandard, JEditor,
JElement, JElementCalendar, JElementCategory, JElementEditors, JElementFileList, JElementFolderList,
JElementHelpsites, JElementHidden, JElementImageList, JElementLanguages, JElementList, JElementMenu,
JElementMenuItem, JElementPassword, JElementRadio, JElementSection, JElementSpacer, JElementSQL,
JElementText, JElementTextarea, JElementTimezones, JElementUserGroup, JHtml, JHtmlBehavior,
JHtmlContent, JHtmlEmail, JHtmlForm, JHtmlGrid, JHtmlImage, JHtmlList, JHtmlMenu, JHtmlSelect,
JPagination, JPane, JParameter, JToolBar, JInstaller, JInstallerComponent, JInstallerHelper, JInstallerLanguage,
JInstallerModule, JInstallerPlugin, JInstallerTemplate, JHelp, JLanguageHelper, JLanguage, JMailHelper, JMail,
JPluginHelper, JPlugin, JRegistry, JRegistryFormat, JRegistryFormatINI, JRegistryFormatPHP,
JRegistryFormatXML, JSession, JSessionStorage, JSessionStorageApc, JSessionStorageDatabase,
JSessionStorageEaccelerator, JSessionStorageMemcache, JSessionStorageNone, JSessionStorageXcache,
JAuthentication, JAuthorization, JUserHelper, JUser, JArrayHelper, JBuffer, JDate, JSimpleCrypt, JSimpleXML,
JSimpleXMLElement, JString, JUtility
Getting Started
     Hello World!
Criando um componente
         Para um componente básico
          são necessários 5 arquivos

 • site/hello.php
 • site/controller.php
 • site/views/hello/view.html.php
 • site/views/hello/tmpl/default.php
 • hello.xml
index.php?option=com_hello&view=hello
      /**
 *   @package    Joomla.Tutorials
 *   @subpackage Components
 *   components/com_hello/hello.php
 *   @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
 *   @license    GNU/GPL
*/

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

// Require the base controller

require_once( JPATH_COMPONENT.DS.'controller.php' );

// Require specific controller if requested
if($controller = JRequest::getWord('controller')) {
    $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}

// Create the controller
$classname    = 'HelloController'.$controller;
$controller   = new $classname( );

// Perform the Request task
$controller->execute( JRequest::getVar( 'task' ) );

// Redirect if set by the controller
$controller->redirect();


site/hello.php
/**
*    @package    Joomla.Tutorials
*    @subpackage Components
*    @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
*    @license    GNU/GPL
*/

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport('joomla.application.component.controller');

/**
  * Hello World Component Controller
  *
  * @package     Joomla.Tutorials
  * @subpackage Components
  */
class HelloController extends JController
{
     /**
       * Method to display the view
       *
       * @access    public
       */
     function display()
     {
          parent::display();
     }
}

site/controller.php
/**
 *   @package    Joomla.Tutorials
 *   @subpackage Components
 *   @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
 *   @license    GNU/GPL
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );

/**
  * HTML View class for the HelloWorld Component
  *
  * @package HelloWorld
  */
class HelloViewHello extends JView
{
     function display($tpl = null)
     {
         $greeting = "Hello World!";
         $this->assignRef( 'greeting', $greeting );

          parent::display($tpl);
     }
}



site/views/hello/view.html.php
<?php
             // No direct access
             defined( '_JEXEC' ) or die( 'Restricted access' );
             ?>

             <h1><?php echo $this->greeting; ?></h1>




site/views/hello/tmpl/default.php
<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.5.0">
 <name>Hello</name>
 <!-- The following elements are optional and free of formatting constraints -->
 <creationDate>2007-02-22</creationDate>
 <author>John Doe</author>
 <authorEmail>john.doe@example.org</authorEmail>
 <authorUrl>http://www.example.org</authorUrl>
 <copyright>Copyright Info</copyright>
 <license>License Info</license>
 <!-- The version string is recorded in the components table -->
 <version>1.01</version>
 <!-- The description is optional and defaults to the name -->
 <description>Description of the component ...</description>

 <!-- Site Main File Copy Section -->
 <!-- Note the folder attribute: This attribute describes the folder
      to copy FROM in the package to install therefore files copied
      in this section are copied from /site/ in the package -->
 <files folder="site">
  <filename>controller.php</filename>
  <filename>hello.php</filename>
  <filename>index.html</filename>
  <filename>views/index.html</filename>
  <filename>views/hello/index.html</filename>
  <filename>views/hello/view.html.php</filename>
  <filename>views/hello/tmpl/default.php</filename>
  <filename>views/hello/tmpl/index.html</filename>
 </files>
</install>

site/views/hello/tmpl/default.php
Perguntas?
             rene.muniz@fabricalivre.com.br




http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1

Contenu connexe

Tendances

Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Michelangelo van Dam
 
Mocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnitMocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnitmfrost503
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Michelangelo van Dam
 
Functional Structures in PHP
Functional Structures in PHPFunctional Structures in PHP
Functional Structures in PHPMarcello Duarte
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxMichelangelo van Dam
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в MagentoMagecom Ukraine
 
Gravity Forms Hooks & Filters
Gravity Forms Hooks & FiltersGravity Forms Hooks & Filters
Gravity Forms Hooks & Filtersiamdangavin
 
The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010Fabien Potencier
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11Michelangelo van Dam
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Chris Alfano
 
Beginning PHPUnit
Beginning PHPUnitBeginning PHPUnit
Beginning PHPUnitJace Ju
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4Javier Eguiluz
 
Zf2 how arrays will save your project
Zf2   how arrays will save your projectZf2   how arrays will save your project
Zf2 how arrays will save your projectMichelangelo van Dam
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolGordon Forsythe
 
Intermediate SQL with Ecto - LoneStar ElixirConf 2018
Intermediate SQL with Ecto - LoneStar ElixirConf 2018Intermediate SQL with Ecto - LoneStar ElixirConf 2018
Intermediate SQL with Ecto - LoneStar ElixirConf 2018wreckoning
 

Tendances (20)

Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013
 
Mocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnitMocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnit
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 
PhpBB meets Symfony2
PhpBB meets Symfony2PhpBB meets Symfony2
PhpBB meets Symfony2
 
Functional Structures in PHP
Functional Structures in PHPFunctional Structures in PHP
Functional Structures in PHP
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
 
Gravity Forms Hooks & Filters
Gravity Forms Hooks & FiltersGravity Forms Hooks & Filters
Gravity Forms Hooks & Filters
 
The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010
 
Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
 
PHP MVC
PHP MVCPHP MVC
PHP MVC
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Facelets
FaceletsFacelets
Facelets
 
Symfony2 and AngularJS
Symfony2 and AngularJSSymfony2 and AngularJS
Symfony2 and AngularJS
 
Beginning PHPUnit
Beginning PHPUnitBeginning PHPUnit
Beginning PHPUnit
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 
Zf2 how arrays will save your project
Zf2   how arrays will save your projectZf2   how arrays will save your project
Zf2 how arrays will save your project
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 
Intermediate SQL with Ecto - LoneStar ElixirConf 2018
Intermediate SQL with Ecto - LoneStar ElixirConf 2018Intermediate SQL with Ecto - LoneStar ElixirConf 2018
Intermediate SQL with Ecto - LoneStar ElixirConf 2018
 

Similaire à Joomla! Components - Uma visão geral

symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207patter
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Michelangelo van Dam
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQueryRemy Sharp
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascriptaglemann
 
From CakePHP to Laravel
From CakePHP to LaravelFrom CakePHP to Laravel
From CakePHP to LaravelJason McCreary
 
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Eric Hogue
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for JoomlaLuke Summerfield
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8PrinceGuru MS
 
Core Php Component Presentation
Core Php Component PresentationCore Php Component Presentation
Core Php Component PresentationJohn Coonen
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitJames Fuller
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy CodeRowan Merewood
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.Mark Rees
 
Ditching JQuery
Ditching JQueryDitching JQuery
Ditching JQueryhowlowck
 

Similaire à Joomla! Components - Uma visão geral (20)

symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 
Frontin like-a-backer
Frontin like-a-backerFrontin like-a-backer
Frontin like-a-backer
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascript
 
Wt unit 2 ppts client side technology
Wt unit 2 ppts client side technologyWt unit 2 ppts client side technology
Wt unit 2 ppts client side technology
 
Wt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technologyWt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technology
 
From CakePHP to Laravel
From CakePHP to LaravelFrom CakePHP to Laravel
From CakePHP to Laravel
 
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
 
Introduction to Zend Framework
Introduction to Zend FrameworkIntroduction to Zend Framework
Introduction to Zend Framework
 
前端概述
前端概述前端概述
前端概述
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8
 
Core Php Component Presentation
Core Php Component PresentationCore Php Component Presentation
Core Php Component Presentation
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.
 
Ditching JQuery
Ditching JQueryDitching JQuery
Ditching JQuery
 
jQuery Basic API
jQuery Basic APIjQuery Basic API
jQuery Basic API
 
J query training
J query trainingJ query training
J query training
 

Dernier

Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfChristopherTHyatt
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfEasyPrinterHelp
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 

Dernier (20)

Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 

Joomla! Components - Uma visão geral

  • 1. Joomla! Components (Uma Visão Geral) René Muniz Desenvolvedor Joomla! Fábrica Livre
  • 3. Conceitos • PHP (Doh!) • OOP (Programação Orientada a Objetos) • MVC (Model-View-Controller) • Joomla! Framework
  • 4. Programação Orientada a Objetos (OOP)
  • 6. class StarFighter { public $size; public $color; public $wings; public $droid; public $guns = array(); function accelerate() { /* Procedure to accelerate here */ } function shoot() { /* Procedure to shoot something here */ } } $XWing = new StarFighter(); $XWing->size = "2.2 metters"; $XWing->color = "#FFFFFF"; $XWing->wings = "4"; $XWing->droid = "1"; $XWing->guns = array("regular" => 4, "bomb" => 1); Classe StarFighter
  • 13. Joomla’s API (http://api.joomla.org) JFactory, JRoute, JText, JVersion, JApplication, JApplicationHelper, JComponentHelper, JController, JMenu, JModel, JModuleHelper, JPathway, JRouter, JView, JObject, JObservable, JObserver, JTree, JNode, JCache, JCacheCallback, JCacheOutput, JCachePage, JCacheStorage, JCacheStorageApc, JCacheStorageEaccelerator, JCacheStorageFile, JCacheStorageMemcache, JCacheStorageXCache, JCacheView, JClientHelper, JFTP, JLDAP, JDatabase, JDatabaseMySQL, JDatabaseMySQLi, JRecordSet, JTable, JTableARO, JTableAROGroup, JTableCategory, JTableComponent, JTableContent, JTableMenu, JTableMenuTypes, JTableModule, JTablePlugin, JTableSection, JTableSession, JTableUser, JDocument, JDocumentError, JDocumentFeed, JDocumentHTML, JDocumentPDF, JDocumentRaw, JDocumentRenderer, JDocumentRendererAtom, JDocumentRendererComponent, JDocumentRendererHead, J D o c u m e n t R e n d e r e r M e s s a g e , JDocumentRendererModule, JDocumentRendererModules, JDocumentRendererRSS, JBrowser, JRequest, JResponse, JURI, JError, JException, JLog, JProfiler, JDispatcher, JEvent, JArchive, JArchiveBzip2, JArchiveGzip, JArchiveTar, JArchiveZip, JFile, JFolder, JPath, JFilterInput, JFilterOutput, JButton, JButtonConfirm, JButtonCustom, JButtonHelp, JButtonLink, JButtonPopup, JButtonSeparator, JButtonStandard, JEditor, JElement, JElementCalendar, JElementCategory, JElementEditors, JElementFileList, JElementFolderList, JElementHelpsites, JElementHidden, JElementImageList, JElementLanguages, JElementList, JElementMenu, JElementMenuItem, JElementPassword, JElementRadio, JElementSection, JElementSpacer, JElementSQL, JElementText, JElementTextarea, JElementTimezones, JElementUserGroup, JHtml, JHtmlBehavior, JHtmlContent, JHtmlEmail, JHtmlForm, JHtmlGrid, JHtmlImage, JHtmlList, JHtmlMenu, JHtmlSelect, JPagination, JPane, JParameter, JToolBar, JInstaller, JInstallerComponent, JInstallerHelper, JInstallerLanguage, JInstallerModule, JInstallerPlugin, JInstallerTemplate, JHelp, JLanguageHelper, JLanguage, JMailHelper, JMail, JPluginHelper, JPlugin, JRegistry, JRegistryFormat, JRegistryFormatINI, JRegistryFormatPHP, JRegistryFormatXML, JSession, JSessionStorage, JSessionStorageApc, JSessionStorageDatabase, JSessionStorageEaccelerator, JSessionStorageMemcache, JSessionStorageNone, JSessionStorageXcache, JAuthentication, JAuthorization, JUserHelper, JUser, JArrayHelper, JBuffer, JDate, JSimpleCrypt, JSimpleXML, JSimpleXMLElement, JString, JUtility
  • 14. Getting Started Hello World!
  • 15. Criando um componente Para um componente básico são necessários 5 arquivos • site/hello.php • site/controller.php • site/views/hello/view.html.php • site/views/hello/tmpl/default.php • hello.xml
  • 16. index.php?option=com_hello&view=hello /** * @package Joomla.Tutorials * @subpackage Components * components/com_hello/hello.php * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1 * @license GNU/GPL */ // No direct access defined( '_JEXEC' ) or die( 'Restricted access' ); // Require the base controller require_once( JPATH_COMPONENT.DS.'controller.php' ); // Require specific controller if requested if($controller = JRequest::getWord('controller')) { $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php'; if (file_exists($path)) { require_once $path; } else { $controller = ''; } } // Create the controller $classname = 'HelloController'.$controller; $controller = new $classname( ); // Perform the Request task $controller->execute( JRequest::getVar( 'task' ) ); // Redirect if set by the controller $controller->redirect(); site/hello.php
  • 17. /** * @package Joomla.Tutorials * @subpackage Components * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1 * @license GNU/GPL */ // No direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('joomla.application.component.controller'); /** * Hello World Component Controller * * @package Joomla.Tutorials * @subpackage Components */ class HelloController extends JController { /** * Method to display the view * * @access public */ function display() { parent::display(); } } site/controller.php
  • 18. /** * @package Joomla.Tutorials * @subpackage Components * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1 * @license GNU/GPL */ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view' ); /** * HTML View class for the HelloWorld Component * * @package HelloWorld */ class HelloViewHello extends JView { function display($tpl = null) { $greeting = "Hello World!"; $this->assignRef( 'greeting', $greeting ); parent::display($tpl); } } site/views/hello/view.html.php
  • 19. <?php // No direct access defined( '_JEXEC' ) or die( 'Restricted access' ); ?> <h1><?php echo $this->greeting; ?></h1> site/views/hello/tmpl/default.php
  • 20. <?xml version="1.0" encoding="utf-8"?> <install type="component" version="1.5.0"> <name>Hello</name> <!-- The following elements are optional and free of formatting constraints --> <creationDate>2007-02-22</creationDate> <author>John Doe</author> <authorEmail>john.doe@example.org</authorEmail> <authorUrl>http://www.example.org</authorUrl> <copyright>Copyright Info</copyright> <license>License Info</license> <!-- The version string is recorded in the components table --> <version>1.01</version> <!-- The description is optional and defaults to the name --> <description>Description of the component ...</description> <!-- Site Main File Copy Section --> <!-- Note the folder attribute: This attribute describes the folder to copy FROM in the package to install therefore files copied in this section are copied from /site/ in the package --> <files folder="site"> <filename>controller.php</filename> <filename>hello.php</filename> <filename>index.html</filename> <filename>views/index.html</filename> <filename>views/hello/index.html</filename> <filename>views/hello/view.html.php</filename> <filename>views/hello/tmpl/default.php</filename> <filename>views/hello/tmpl/index.html</filename> </files> </install> site/views/hello/tmpl/default.php
  • 21. Perguntas? rene.muniz@fabricalivre.com.br http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1