Category: twig

Twig – the Most Popular Stand-Alone PHP Template Engine

Twig is a template engine for PHP. But isn’t PHP itself a template engine? Yes and no! Even though PHP started as a template engine, it didn’t evolve like one, and while we can still use it as one please tell me which version of “Hello world” you prefer: <?php echo "<p> Hello " . $na...

Amazon Product API Exploration: Let’s Build a Product Searcher

In this tutorial, you’ll take a look at Amazon’s Product Advertising API. It’s an API that allows developers to access data about items for sale, seller reviews, customer reviews, and product promotions on all Amazon marketplaces worldwide. Basic API Concepts When working with the API, the first th...

Shopify App Development Made Simple with HTTP APIs and Guzzle

In this tutorial, you’re going to get started with developing Shopify apps. You’re going to create a simple app that lists out products from a Shopify store. The full source code of the app is available on Github. What are Shopify Apps? Shopify apps are a way of extending the functionality of a Shopify sto...

Sculpin Extended: Customizing Your Static Site Blog

If you’re a PHP developer and currently running a blog with a static site generator such as Octopress or Jekyll, wouldn’t it be great if you could use your primary language for it? Yes, it’s healthy for us developers to use more than one language, but let’s be honest – we often want to add...

Quick Tip: Convenience Hacks for Passing Data to Views

In MVC based architectures, working with template engines is an inevitable part of the development routine. It usually goes like this: we prepare and pass the data to the view. In the view, we print them based on our layout design. Here is a basic example of how it works using Twig. <?php // Twig initialization...

Easy Multi-Language Twig Apps with Gettext

There are many approaches for adding new languages to your application’s UI. Though some userland solutions like symfony/translation are arguably simpler to use, they’re slower than the good old native gettext by an order of several magnitudes. In this tutorial, we’ll modify an English-only application to use get...

Building an Spress Svbtle Theme – Responsive Static Blogs!

You may have heard of Sculpin – a static site generator for PHP. Static blogs are, as you may know, blogs which you dynamically write in your app or on your local machine, and then export as a pure HTML version for hosting on static-only servers, for speed, reliability, and offline-first friendliness. While easy ...

Using Templating Engines to Streamline WordPress Theme Development

The following is a guest post by Charlie Walter. Charlie has written for us before, when he’s not making me extremely envious. Now he’s back to share something completely different. We’re going to learn about methods he’s learned for streamlining WordPress theming using templating engines. Templ...

OCR in PHP: Read Text from Images with Tesseract

Optical Character Recognition (OCR) is the process of converting printed text into a digital representation. It has all sorts of practical applications — from digitizing printed books, creating electronic records of receipts, to number-plate recognition and even circumventing image-based CAPTCHAs. Tesseract is an o...