Accessing “dot” namespaced services in Twig view

I know that I can access registered services by using the dot notation in a Twig template (example app.request.host). However, if I've created my own namespaced service (in this case tagframe.photoservice), when I try to access it, I am given an error that the method "tagframe" doesn't exist on the object "Silex\Application". Is it possible to access services that have been dot namespaced? In other words, a service that I would normally access using $app['tagframe.photoservice'] in the controller?

Answers


Yes, just like accessing array:

{{ app["tagframe.photoservice"].resizePhoto() }}

Need Your Help

Segfault when I delete an object - GDB says in free()

c++ c memory memory-management

I am working on an assignment for networking where we are supposed to create a networking library in C and then use it in our C++ program. My C++ isn't as strong as my C so I got started on that fi...

Having issues styling a three column footer (divs inside footer tag?)

html css footer

I'd like to style a three-column 'fat footer' at the bottom of my site. I was able to set up the general footer tag correctly (the background color, size and positioning of the whole footer), but I...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.