In the last article we have covered twig templating basics concepts. Now it’s time to extend functionalities, which can be very useful. Twig has a fair amount of built-in functions, tags, filters and operators but in some cases, you will find that not sufficient. We will cover how to extend twig and what can be extended with examples.
Read moreSymfony
Symfony templating with Twig
Symfony 4, (further in the text – Symfony) for templating provides twig bundle, which is a very useful templating engine. It is built by SensioLabs – the company behind Symfony. Besides Symfony, there are more platforms supporting Twig such as Drupal8, eZPublish, phpBB, Piwik, OroCRM, etc. In this article we will cover the basics and show how to extend them. Twig is by default not installed with Symfony, you need to include symfony/twig-bundle with the composer (composer require symfony/twig-bundle).
Read moreSymphony of PHP – Symfony 4
You have probably heard of PHP framework called Symfony, today I will share my and Inchoo’s experience with this great framework. You can basically do anything in Symfony, but the most important question you should ask yourself is: Should I use Symfony for my application? In order to help you answer the question, I will try to explain basic concepts, give my thoughts and share some experiences in eCommerce development.
Read moreSymfony, HWIOAuthBundle and Google Sign-in
Recently I have been working on a Symfony based project that among other things required a Google Sign-in process. Actually, within that project one could say that Google Sign-in will be the only login authentication. Now, if you Google “Symfony login”, among first results are links for official Symfony documentation like the one for Security page.
Read moreSymfony2 – remember me cookies
When developing web services for mobile devices to handle user log-in, I had to make it persistent somehow, so the user should not log-in each time when starts mobile application, but I rather wanted log in to be permanent somehow while user does not log-out manually.
Read moreSymfony2 DBAL QueryBuilder
Sometimes, when we have some relatively complex queries to write, it’s so long and inflexible statement that it’s pretty hard to understand few days after we wrote it, or we have to add some dynamic parameters or conditions that writing plain DBAL statement could be real nightmare …
Read moreSymfony2 DBAL array parameters
Few days ago I had to use DBAL statement that will execute SQL IN(somearray) statement.
Considering that I used Doctrine DBAL in this part of code, I had to find the proper way of doing it.
I wrote some basic things about using Doctrine DBAL inside Symfony2 project, but I didn’t ever need this one before until now …
Symfony2 caching Doctrine2 results
There are many options developer can use for speeding up web application. But you already knew that…
Let’s skip long introduction and show by example:
Configuring Symfony2 to use APC cache
Symfony2 support several caching systems and one of them is APC cache.
This article is going to be short …. but, everything in Symfony2 is so developer friendly that do not require some huge knowledge to accomplish …
Read moreSymfony2 custom config parameters
Sometimes we need to add some static configuration options inside our project that will be accessible from whole project scope.
Read moreSymfony2 global variables in TWIG
Except well documented TWIG functions like: path(), asset(), … and custom variables you pass into view from controller when rendering some TWIG template, Symfony2 provides an easy way to access some ‘global’ variables inside TWIG templates without explicitly sending those to the view from controller.
Read moreSymfony2 force HTTPS with .htaccess
Lots of posts are written on forcing HTTPS on routes, but I didn’t find one that is suitable for my Symfony2 installation, so I tried to write combination that will work for my project.
Read moreChunked transfer encoding with Php
Few days ago I played with my Symfony2 project and tried to implement chunked transfer of data to the browser / web service client.
So, what is chunked transfer encoding anyway?
Read moreSymfony2 REST – reading data from PUT request
I know that this is not so advanced theme to write about, but let me write few articles about little things that can bother developers and take time for searching and googling.
This article is mostly general php and not strictly Symfony2, but sometimes you will find this useful in your project.
Just to be clear: there is native Symfony 2 way to do that with using:
$request->get('key')
and I am going to explain other possibilities here…
Read moreSymfony2 registering Doctrine Event Listeners
Handling for example status change inside one entity and automatic updating status on another entity is not so trivial task. We should be aware of possible status combinations depending of actions taken.
Read more