The other day, i wanted to write a controller that expects an object as an action parameter, with the help of a custom router. Writing the router was as easy as adding a field to the array i return in the match() method. But then sometimes the controller has to send a redirection response. In production mode, everything works fine.
But in debug mode, i got a - very non-telling - error about serializing:
Notice: serialize(): "controller" returned as member variable from __sleep() but does not exist in /home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php line 30
Symfony documentation recommends to use XML for dependency injection configuration. I like the yml format because its simple and intuitive, but the main benefit of XML is the possibility for better validation and editing help.
So today we tried to port some configuration from yaml to xml.
Our yaml file contained an array parameter:
parameters:
symfony_cmf_multilang_content.lang_preference:
en: [en, de]
de: [de, en]
To make this work in XML, you need to nest parameter tags and use the type="collection" attribute.
<parameters>
<parameter key="symfony_cmf_multilang_content.lang_preference" type="collection">
<parameter key="en" type="collection">
<parameter>en</parameter>
I often want to have my controllers be a service so you can inject some information. But at the same time i like to extend the base controller Symfony\Bundle\FrameworkBundle\Controller\Controller to have the convenience methods like $this->render. Now if you just create a service from your controller, you won't be able to use the methods anymore. You will get exceptions about calling get() on a non-object.
What you need to do is inject the service_container to your controller manually.
<service id="liip_vie.viecontroller" class="%liip_vie.viecontroller.class%" public="true">
<argument type="service" id="service_container"/>
...
</service>
services:
I repost some of my blog posts made @ liip. Please see here for the original post and comments: http://blog.liip.ch/archive/2011/09/27/a-frontend-editor-for-symfony2-cm...
Yesterday we started working on an editor for the Symfony2 Content Management Editor, the LiipVieBundle. We use VIE and - until something non-GPL comes along - the Aloha editor. VIE is a piece of javascript on top of backbone.js that handles storing data with a REST backend. In Symfony2, this is a breeze thanks to the FOSRestBundle. Sounds complicated? Its actually quite simple, at least for the user. I made a short video to show how it looks.
I repost some of my blog posts made @ liip. Please see here for the original post and comments: http://blog.liip.ch/archive/2011/08/04/symfony-cmf-camp-italy-wrap-up.html
Last week, Lukas and me went to Italy to join the CMF Camp. Thanks a lot Ideato for hosting and organizing the event! Apart from meeting friendly people from Italy and Germany, eating lots of pizza and other great italian food, we discussed the Symfony content management framework and did a lot of coding on the second day.
I repost some of my blog posts made @ liip. Please see here for the original post and comments: https://blog.liip.ch/recap-symfony-live-conference-in-paris.html
Last week, there was the Symfony Live conference in Paris. The conference was surprisingly big, about 500 developers came together in the impressing building of Cité Universitaire Internationale. The main topic was of course the upcoming Symfony2 release. We had two days of talks and a hackday on Saturday, and lots of fun every night. The topics are on the conference website, some discussion and slides are on joind.in.
I repost some of my blog posts made @ liip. Please see here for the original post and comments: https://blog.liip.ch/hackday-for-symfony2-cmf.html
Last week we had a hackday on the Symfony2 CMF. We played with the first CMF sandbox and made it do some basic things. You can see the result with some simplistic cms at our sandbox clone. It just shows a node (at route /cms/<path>), assuming you first created some nodes (at /admin). Along with the node itself, we show the breadcrumb and child nodes, to demonstrate how the hierarchy can be used.
I repost some of my blog posts made @ liip. Please see here for the original post and comments: http://blog.liip.ch/archive/2010/12/03/php-content-repository-full-imple...
Recently, I put a finishing cleanup on the PHPCR API, the port of the Java Content Repositry API (JCR) to PHP. PHPCR is implemented by Jackalope, which got a whole team at Liip working at it to fix the failing tests and fill in missing bits.
You might have heard that we started to port the Java Content Repository (JCR) standard to PHP. If not, read the Jackalope post from last year.