eZ Community » Forums » eZ Publish 5 Platform » What do your controllers do?
expandshrink

What do your controllers do?

What do your controllers do?

Wednesday 01 May 2013 4:30:59 pm - 2 replies

Pull Request 280 has turned in to a bit of an architectural discussion. 

One of the questions that has arisen is this: What are you doing in your custom controllers? The idea is that we want to make sure that eZ 5 provides good tools to make it easy to handle common CMS use cases in a standard way. That enables developers to focus more time on their custom code, and it makes code more shareable since the common tools are truly common to everyone. 

So if you've built a site in eZ 5, take a look at your controllers and listeners. What are you doing with them? And is it something that every site will have to do, or a particular requirement of your project? 

Looking at my projects, here are the things I've been writing controller actions or listeners to handle: 

  • using a "Look And Feel/Design" object to set general things for the layout. I used a PreContentView listener for this
  • Related objects. I've written sub-requests to pull and format related objects
  • sub-content. Most of my controller actions are concerned with things I used to use 'fetch' for, like pulling the blog posts under a blog
  • RSS feeds. I've written actions to use ezcFeed to generate RSS
  • Tree-walking. I have a controller action that walks up the tree from the current node and returns the first object it finds with a populated sidebar, so that I can set sidebar content at any level of the tree.

Are there other things you've done that don't fall into one of those categories? I'm curious to hear what you all are doing, and what code you carry from project to project.

Modified on Wednesday 01 May 2013 4:31:33 pm by Joe Kepley

Thursday 02 May 2013 8:18:52 am

Hello,

For now :

  • Call an external API (like Twitter API) : kinda specific use case
  • Get Content related to a Tag : and more generally use searchService with different criterion
  • Build a menu

And other use cases that you already mention (children, rss, ...)

Friday 03 May 2013 6:04:45 am

The reply has been removed because of violation of forum rules.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from