Rafał Wrzeszcz - Wrzasq.pl

Symfony2 your way

Sunday, 29 June 2014, 23:01

Last Friday, on Tech Fusion (a tech meetup in Szczecin, Poland), I had a talk about using Symfony2 to build own applications. The main purpose of it was to present various ways in which this flexible framework can be adapted to the needs of your application (without doing dirty, nasty and ugly hacks). It's not a complete compendium - a form of a meetup restricted it to be a maximum of 30 minutes talk, to present essential solutions and aspects of this subject. If you missed it, don't worry! It's already available online on SlideShare.

Tags: Symfony, Web, Szczecin, Portfolio, Presentation, Kod, Tutorial, Meetup, PHP

» Komentarze

ChillDevSpintax library - objective PHP library for spintax texts

Friday, 24 January 2014, 21:03

I'm working right now on a SEO tool and a must-have feature for such tools is support for spintax texts. It's a really common requirement so I though that there are planty of libraries for PHP to work with it. To my surprise I've hardly found any code snippet, not even a "complete" libraries and what's more most of them was… let's say it straight - crappy. Especially that project I'm working on requires a little more then just generating random texts, I need to remember and exclude already generated combinations etc. I had no other way than developing own library to deal with it, but since it's a completely stand-alone solution I decided to publish it as open source project - ChillDevSpintax library.

Tags: Web, SEO, Code, Tutorial, Spintax, ChillDev, PHP

» Komentarze

Symfony2 - global templating variables in PHP renderer with ChillDevViewHelpersBundle

Wednesday, 15 January 2014, 18:45

Short time ago, while working on one of my projects i faced a problem with PHP templating engine in Symfony2 (again the same) - passing pre-defined variables to view renderer. For some reason it's not possible to define global variables for PHP templating engine. It is possible for Twig (with TwigBundle), but there is no equivalent of that for PHP. After googling for a moment and browsing some of Stack Overflow questions I ensured myself that it's not possible and that I'm not the only one who is looking for such a feature.

Tags: Symfony, Code, ChillDev, Bundle, PHP

» Komentarze

Symfony2 - creating adapter-dependent sub-forms

Wednesday, 11 September 2013, 19:04

I think this is quite commonly needed feature - form structure that vary depending on some other field(s). The project, on which I'm currently working, is integrated with a lot of external APIs which usually require additional per-user options for each of them. It's a SEO tool and - to pick an example - provides various indexing services integration. Some of them require API key, some require login and password, some specify different URLs. So for each of them form structure can differ. Of course you could use some conditions to pick correct structure, but it's not enough - form needs to change together with selected option. There are some partial tutorials on the web how to alternate form based on events, but it's just one part of the solution - here is more complex one.

Tags: Symfony, Forms, Code, Tutorial, PHP

» Komentarze

Symfony2 - simple, yet useful tips

Monday, 17 June 2013, 16:24

It's been a while since my last article and activity, as I was mainly concentrated on my private life and commercials projects, but even though my top commitment was updating projects dependencies on GitHub I also experimented with some different approaches for organising Symfony2 projects. I want to share some of my thoughts, so you may also benefit from using it or tell me why these ideas are stupid. I don't want to write here some obvious stuff like "write unit tests", "use Composer" etc. - you can read that in every single tutorial for Symfony2. Some of my tricks are plain simple but not obvious, some, on the other hand look strange, but saved my ass, so you can give them a try. Please excuse my a bit chaotic form (and content), but I'm writing this in my free time while commuting by train :P.

Tags: Symfony, Optimization, ChillDev, Production, PHP

» Komentarze

ChillDevProxyTemplatingBundle - make your vendor bundle independent on templating engine

Saturday, 30 March 2013, 15:19

When working on ChillDevFileManagerBunde I faced a problem of implementing template engine switch to allow using it in systems that maybe use different templating engine then bundle was created for. Some common vendor bundles (like FOSUserBundle) try to provide such feature by manually creating template references in actions depending on their bundle configuration parameters. I know most Symfony 2 projects use Twig, but (as you maybe know already) I don't like it and use plain PHP templates. And that's not all - Symfony-based projects can use other templating engines, like Smarty for example. Vendor bundles should be possible to use in your system regardless of templating engine you use.

Tags: Symfony, Tutorial, ChillDev, Bundle, PHP

» Komentarze

ChillDevFileManagerBundle - Filemanager frontend bundle for Symfony 2

Tuesday, 25 December 2012, 23:33

In my old projects I often needed direct file operations to change something in system. The easiest way is to do that from shell, or through SFTP, but on many shared hostings there is no way to do that. Using FTP on the other hand is not very handy on mobile devices. Because of that I implemented web-based filemanager features in them. Now all my Symfony 2 projects run on dedicated servers and most things are handled at build and deploy time, but from time to time I miss some of these featues. I thought there must be some kind of filemanager for Symfony 2 since it looked like a quite generic part of system. But there wasn't… until now (well, maybe not yet, but starting to be). I've published ChillDevFileManagerBundle - this is currently just a stub with a very limited features, but will of course grow to become (hopefuly) real filemanager that works out -of-the-box with your Symfony 2 installation.

Tags: Symfony, Filesystem, Tutorial, ChillDev, Bundle, PHP

» Komentarze

ChillDevViewHelpersBundle - PHP templating helpers for Symfony 2

Thursday, 15 November 2012, 10:33

To keep my projects up-to-date some time ago I've chosen Symfony 2 as a base framework to replace outdated Zend Framework (version 1 is old and far behind moder web and version 2 development is far behind Symfony's and the new ZF2 is bloated and messed up). Symfony 2 is a great framework, but there is one thing that I can't understand - why the hell use Twig!? For years people were migrating from engines like Smarty to plain PHP views/templates yelling that templating engines for PHP are stupid idea; and I fully support this thesis. PHP is a great templating engine by default, this is what PHP was created for at it's basic purpose: it's not like Python or Java where you need to send output explicitely - this is the sole feature in case of PHP. Why bloat it with additional templating layer? I personally consider Twig as a step backward and stay with plain-PHP templates. Unfortunately people followed Twig-based conventions and if you want to use PHP renderer you need to do many things on your own - most of popular bundles comes only with extensions for Twig, but not with helpers for PHP rendering engine. This is where ChillDevViewHelpersBundle comes in! It is set of basic helpers for PHP-based templates (hope to extend it in future of course).

Tags: Symfony, XHTML, Tutorial, ChillDev, Bundle, PHP

» Komentarze

Pork - fork() for PHP

Tuesday, 10 January 2012, 10:24

You always hear how many things modern computers can do at once, how multi-tasking they are… but when it comes to your simple mailing script it hangs on sending few mails and it can't go further. How it is that you run your application on powerful server machine, but your script flow is completely single-tasking? Well, machines and operating systems supports multi-tasking, but you have to write your code in specific way in order to benefit from it - you have to split your program into multiple single tasks that can be executed parallelly. If you are a PHP developer and you need something for multi-tasking, here I give you Pork - fork() for PHP.

Tags: Pork, Skrypty, Code, Kod, PHP

» Komentarze

Hormon 0.0.2

Sunday, 12 December 2010, 00:15

This version has been released because there are some significant changes. I want to describe them bit more descriptive than single line in CHANGELOG.txt.

Tags: Skrypty, Hormon, Kod, SQL, ORM, PHP

» Komentarze