Skip to content

ballinette/ezobject

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

ezobject

Symfony Bundle eZObjectWrapperBundle for eZ Publish 5 development eZ 5.3).

version 1.0 24/10/2014

Developed in Kaliop's team.

Description

This bundle offer a simple model to encapsulate location and content for eZPublish 5 development. It provide a factory to build eZObjectWrapper and extended classes. eZObjectWrapper provide a lazy-loading method to fetch content. Extended classes can offer method to fetch secondary contents without overloading main controller and creating new kernel request. Extended classes are built via a class_mapping in parameters.yml

It also provide a Twig function, nammed renderLocation, wich use the ViewController as a service, and did not relaunch the Symfony kernel, for more efficiency.

Usage

  • To build eZObjectWrapper : get the service : $factory = $this->container->get('ezobject_wrapper.services.factory'); build : $factory->buildeZObjectWrapper($location); buildeZObjectWrapper can accept Location or locationID as parameter.

  • Class mapping : parameters: class_mapping: content_identifier: \myGreat\BundleBundle\eZObjectWrapper\ClassesExtendingeZObjectWrapper

  • renderLocation : {{ renderLocation(locationId, 'view_type', { ezObjectWrapper : myObject }) |raw }}

  • call method or attribute from eZObjectWrapper in Twig : {{ ez_field_value(ezObjectWrapper.content, 'title') }}

Installation

Clone this repository under src/ezobject. In EzPublishKernel.php, ad the following line in the method "registerBundles()" : new ezobject\WrapperBundle\eZObjectWrapperBundle(),

Contact

E-mail : savoie.antonin@gmail.com / asavoie@kaliop.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%