I am not talking about web services, but I am talking about symfony2 service container and the way of basic creating services inside Symfony2 project that are accessible from all other bundles via service container.
Why do I need to make some part of code like service inside Symfony2 anyway?
There is one possible problem:
Using built – in translator with Symfony2 project is pretty simple.
First make sure you enabled it in main config file: config.yml
Recently I started to write web services in my Symfony2 project that will provide JSON data for using with mobile and other devices that will consume that.
On the mobile side, RESTKIT will be used to connect to my services, and on my (web) side I used Symfony2 (of course).
So, let’s write a simple web service:
I will try in short words write about using assetic in Symfony2 project.
Why do I need assetic anyway? What is that?
That was the first question I asked myself before asked my good friend ‘Google’.
I regularly use Doctrine ORM for database operations in my Symfony2 project, but there was one situation that I had to write database importer from SQLITE database into projects Mysql database. Importer should run only once and I didn’t want to make new entity classes for importer, but just make code to work while import is not finished.
In last article about fixtures I wrote about manual setup for using data-fixtures with your Symfony2 project.
Now it’s time to write first data fixture.
As someone of you know there is pretty good feature made in Symfony2 that is worth to mention: Console interface with commands that make our life easier to generate different sort of things in our Symfony2 application and execute many useful commands with Doctrine etc.
First time I was wondering: what will I do with this? Do I need data fixtures?
When started project, soon I realized that fixtures is a must in my project.
Do you want to develop your own Magento mobile application?
Great! I’ll give you some pointers on how to get a grasp on Magento’s XMLConnect, an extension that serves Magento Mobile application.
Using TWIG plug in we made in part1 of this article
It’s highly advised to read part1 first to understand what’s going on.
When our TWIG engine autoloader is ready, and our plugin is activated from wp-admin side, we can go to wordpress themes folder and make new theme folder. Inside our theme folder, let’s make starter file: ‘index.php’ slightly modified to fit our needs:
Making TWIG autoload from WP plugin
Maybe someone will say: this is a crazy idea. Why would someone want to do that?
Maybe it really is crazy, but I would say: why not?
Recently my team had problem with Amazon affiliate links on our web site.
On the web, we have wordpress installation and inside main content of web page we have some Amazon affiliate links that entered in the content few years ago and not working any more because Amazon changed API somehow. I searched the web for some new version of wordpress plug-in for new API version, because our old plug-in for displaying that links properly was turned off.
FYI that links inside content look like this:
Did you ever had problems with Internal server error 500 with symfony2? I did few days ago. When I open my web application in development mode (http://mysymfony2url/app_dev.php/something) It works OK, but when I tried to open it in ‘production’ mode I always got ‘Internal server error 500’ response, so I decided to look at error.log inside my localhost to see what is happening.
Here is what I saw there:
Like everything else, using transactions in Symfony2 is easy task.
I had a case that I had to use transactions to make sure that everything or none is saved to database, because I didn’t wand anything to break at the half way and leave data unsaved.
NOTE: Tested on Symfony2 Beta3. Might not work on later releases!
Symfony2 offers many prebuilt field types for using when creating forms. The one of them I found interesting is ‘EntityType’. There are just basic documentation about that.
I had one case recently that I had to use Entity field type for creating form, but except using it in simple way like documented I wanted to use it on little more advanced way.