Symfony

Sylius custom theme development – initial setup

This post is for you if you are a frontend developer working on Sylius eCommerce platform and you want to build a custom theme for your client. Sylius is mostly oriented towards backend developers and frontend part is only necessary to show what can be built on top of the platform. Frontend segments don’t come with much documentation or guidance, and what is available will help you with the kick start, but after that, you are on your own.

But wait, please, don’t be scared, this platform is actually very easy to use and modify once you master it. In the end you will be able to create anything what you or your client wants. In the very near feature in one of the next releases we are looking forward to seeing a new default theme for Sylius that has all out of the box functionalities which will show the true power of Sylius and what can be built on top of it.

In the meantime, read on…

Read more

Creating Sylius Fixtures

What are fixtures in Sylius?

Fixtures are plain PHP objects that are designed to change current system state by either persisting some entities to the database, uploading files or doing anything else that you might require.

In this post we will be going through the process of creating a bundle and in it our custom fixture , assigning it to our suite.

Read more

Extending Twig in Symfony 4

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 more

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 more

Symphony 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 more

Symfony2 – remember me cookies

© hoefi@sxc.hu

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 more

Symfony2 DBAL QueryBuilder

© ba1969@sxc.hu

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 more

Symfony2 DBAL array parameters

© wimster@sxc.hu

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 …

Read more

Configuring Symfony2 to use APC cache

© mmagallan@sxc.hu

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 more

Symfony2 global variables in TWIG

© personalfx@sxc.hu

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 more

Symfony2 force HTTPS with .htaccess

© CDWaldi@sxc.hu

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 more