RSS Feed
^__^

Symfony and named ParamConverters

,

Symfony’s ParamConverter is a common way to transform some GET param to an entity before your controllers action.
This happens most of the time via type hinting and priority detection kinda magic in the background.
But as magic is often obscure sometimes you need a bit of explicitness.

F.e. when you have more and different ParamConverter per entity you want to name them explicitly.
Then you can use named ParamConverters.

In the documentation this issue is a bit fragmented, so here is the compact version:
» read more

no comments yet

Symfony2 “urlize”

,

I have often missed the

Doctrine_Inflector::urlize()

 method from Doctrine1 in Symfony2 with Doctrine2.

Of course there’s the doctrine extensions with the sluggable behaviour, but sometimes it seems a bit overhead for smaller tasks.

I just recently discovered Behat Transliterator, which brings just the dearly missed urlize function back.

» read more

no comments yet

Git deploy with composer install hook

,

I usually would not recommend deployment via git and running composer on your prod server for several reasons like f.e. the network. I rather believe in builds.
But sometimes its just too convenient :)

So i have this uncritical smaller API app where the hosting has git, ssh access and i am in full control and i decided too keep it simple.
» read more

no comments yet

Enable Twig-Extensions in Silex revisited

,

As of 2014 things have changed improved a lot in the Symfony / Silex world, compared to 2011, when i first blogged about twig extensions in Silex.
Things got more easy, yay!

As Composer appeared, installation and autoloading is a breeze nowadays.
I presume here, that you have installed your Silex project via composer.
If so, you can install the twig extensions like this:
» read more

no comments yet

SilverStripe LinkField addon

,

Alright folks, so here is the SilverStripe addon of the month:
https://github.com/sheadawson/silverstripe-linkable

Its the missing LinkField, you might look for.
There are some more addons for a LinkField out there, but this one is the best.
No wonder, the author is SilverStripe employee.

It features:

  • external links
  • link validation
  • link a page from your site
  • link a file from your assets
  • oEmbed links
  • the addon is translated, currently only for german, but add your own, its easy!

» read more

no comments yet

Bower, require.js, masonry & imagesloaded

,

Wanna run masonry with imagesloaded in require.js, powered by bower?

Try this gist!

First create your bower.json file and run bower install

{
  "name": "bower-masonry-imagesloaded-requirejs",
  "version": "0.0.0",
  "dependencies": {
    "requirejs": "~2.1.8",
    "jquery": "~1.10.2",
    "masonry": "~3.1.2",
    "imagesloaded": "~3.0.4"
  }
}

» read more

no comments yet

Using Silverstripe Templates outside Silverstripe

,

In a recent website-project i had a WordPress Blog running next to the main CMS Silverstripe, handling the Blog-part of the site.

Integrating the Blog in Silverstripe (which indeed would have made things simpler) was not  an option at the time. The usage of loads of WordPress plugins would’ve made a rewrite a major task, which was out of the budget.

The blog was integrated in the same page layout as the rest of the website. So ideally it would at least share the same Templates for header, footer etc. and would integrate the sites navigation built by Silverstripe.

But how to use the pre-rendered Silverstripe template .ss files in a WordPress theme?

The following worked fine for me, using Silverstripe 3.0:
» read more

no comments yet

More Silverstripe bookmarklets

,

Since the Silverstripe-Developer Bookmarklets on ssbits.com are great,
i thought it would be even better to have them as a editable/extendable collection:

So here are some more as a JSFiddle:

http://jsfiddle.net/HMkad/2/embedded/result/ » read more

3 comments

Rename admin menu items in SilverStripe

,

SilverStripe 3.0.x cheap trick of the week:

If you want to rename a menu item in the SilverStripe Admin Area, because f.e. you find “Security” or “Sicherheit”(since we are german ;)) a too harsh wording and you prefer “Members” or “Benutzer”:
simply override the translation!

Add a lang folder in your project folder and add the language file:
de.yml or en.yml and place your wording:

de:
SecurityAdmin:
MENUTITLE: Benutzer

» read more

2 comments

JSfiddle Bookmarklet Generator with jQuery & Codemirror

,

This is a little bookmarklet generator i put together this morning:

http://jsfiddle.net/QMeuV/1/embedded/result/ » read more

1 comment