Rafał Wrzeszcz - Wrzasq.pl

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