Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Master Data Management with Pimcore

Master Data Management with Pimcore

PHP Track at FrOSCon 2018 [en]

Christoph Lühr

August 25, 2018
Tweet

More Decks by Christoph Lühr

Other Decks in Programming

Transcript

  1. By Persian Poet Gal, Surachit, Winstonza, Lord Leatherface, Leptictidium, AnonMoos,

    Chongtin, RuM, Popolon, Uwe Gille, Wyvernoid, Kikos, Hisagi, LambdaCorp, Tux the penguin, Patrol110, 2(L.L.K.)2, Мелкијадес, Homo lupus, Erikire, Jcfidy, Angelito7, Kandar, Router, Lord Leatherface, Whidou, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=39183625
  2. +

  3. +

  4. +

  5. // Object creation $person = Object\Person::create(array( 'name' => 'Chris', 'description'

    => 'Fast talker' )); $person->setWeight(75); $person->save();
  6. +

  7. +

  8. +

  9. // using piplines for asset formats in code: $asset->getThumbnail("marioPipe"); //

    => /thumb_marioPipe/[email protected] $asset->getThumbnail("marioPipe")->getHTML(); // => <img ... srcset / media queries
  10. +

  11. +

  12. !

  13. <?php # src/AppBundle/Controller/BlogController.php: # [..] class BlogController extends FrontendController {

    public function detailAction(Request $request) { $id = $request->get('id'); $article = BlogArticle::getById($id); $this->view->article = $article; } }
  14. <?php class ContentController { /** * Optional: * @Template("AppBundle:Content:portal.html.twig") *

    @Route("/news/portalpage") */ public function portalAction( ) { // custom code: // - retrieve data // - .. // - populate view } }
  15. <?php namespace AppBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use

    Symfony\Component\HttpFoundation\Request; class ContentController extends Controller { /** * @Template("AppBundle:Content:portal.html.twig") -- Optional! * @Route("/news/portalpage") -- Optional! * * @param Request $request * @param array $templateVars * @return array */ public function portalAction(Request $request, array $templateVars) { $templateVars = $this->defaultAction($request, $templateVars); $templateVars['isPortal'] = true; return $templateVars; } }