Bubbling return values in PHP

I got this crazy idea few years ago while building a REST service for one of my projects. I needed some way to represent complex errors happening deep down in the components of the service to the public.

I ended up returning arrays with multiple keys which was really not ideal.

Continue reading “Bubbling return values in PHP”
Macaw LESS CSS Swatches

Converting Macaw: Exciting New Features of Publisher

Last few weeks/days I’ve been mostly polishing the Publisher which comes with templating support for Macaw exported HTML out of the box. Combining the data, translations and Macaw designing has significantly changed how I work.

Continue reading “Converting Macaw: Exciting New Features of Publisher”
Data driven websites using Macaw + Publisher Demo

Tutorial: Turning Macaw into a data-driven multi-language Publisher website

I’ve decided to show you how to change Macaw example website into Publisher powered website with data comming from a data source rather being hard-coded in the Macaw HTML export. Together we’ll create a website in two languages with one design/code base:

I’ll setup a fresh new project for you to follow, but you can already download the end result including the MCW file from it’s repository and study the example file as you read the tutorial.

Publisher is a small flat PHP engine I wrote and I open-sourced it under MIT licence.

Enjoy :)

Continue reading “Tutorial: Turning Macaw into a data-driven multi-language Publisher website”
mustache

In Search for Template Reuse Between Angular.js and PHP

PHP itself is a great templating engine. No doubts. Why to add another overhead? From my perspective is the reuse between back-end and front-end. Why is there need to produce same code on server? Few of my concerns: SEO, usability (fallback for no-javascript on old devices)

Language diferences for building any web apps:

  • on client: HTML + CSS + Javascript
  • on server: HTML + CSS + PHP (or any language of your choice like Ruby, Pyton, Java, ASP,…)

If you are lucky, your host supports Node.js and reuse of templates is very doable. But most of the time you can consider yourself lucky when your host is running latest PHP codebase.

Continue reading “In Search for Template Reuse Between Angular.js and PHP”

PHP Elements in Pursue of a Dedicated API

A few months ago I was considering spicing my coding knowledge with Angular.JS. So I came upon the Dependency Injection concept and I fell in love with it.

I inspected Symfony’s creator thoughts about DI and concluded Symfony components being great but massive for my needs. I wrote my own very simple DependencyContainer class

Time for an excercise.

Continue reading “PHP Elements in Pursue of a Dedicated API”