News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Custom Scripts Blog:
Dynamic layouts in Twig
December 18, 2013 @ 12:18:14

On the Custom Scripts blog they've shared a new tutorial showing you how to use the popular PHP templating tool Twig to create dyanmic layouts for your application.

Recently I worked on a project that needed dynamic layouts for each bundle. The idea was to have a base template, then several layout templates that each extends from the base. Each view would then extend from one of the layout files.

In the scenario I had, I needed to allow each bundle to specify there own stylesheets and javascripts. So each bundle needed to create a custom layout that overrides the parent stylesheet and javascript block adding their own content, and I did not want to re-create the layout files for each bundle.

He's created a base template for the entire site leaving areas for stylesheet and javascript injection as well as making it flexible enough to accept multiple column layouts. Layered on top of this is a base template for each bundle that's then extended via a custom extension class as needed. The PHP is also included to define this and the other extension classes you'll need to make the setup work.

0 comments voice your opinion now!
twig template dyanmic tutorial

Link: http://blog.customscripts.co.za/dynamic-layouts-twig/

LotsOfCode.com:
Tag Cloud Tutorial
September 06, 2007 @ 08:57:00

In this tutorial on the LotsOfCode website, the author looks to help you create a feature common to several (including this one) websites out there - a tag cloud.

In this tutorial i am going to show you how to create a basic word / tag cloud using php. I am going to create a class based cloud, this is because it will be more convenient for people to adapt it on there own websites, if you don't know much about class based programming then click here to take a look at the class tutorial.

They pull the information from their "words array" (where words can be dynamically added to it) and use a percentage rating to base the CSS size for the data's span tag. The entire class listing is provided in one big chunk to make copy and paste easy.

3 comments voice your opinion now!
tag cloud tutorial dyanmic css size class method tag cloud tutorial dyanmic css size class method


Icemelon.com:
Dynamic Images in PHP (with GD)
December 27, 2005 @ 12:08:48

In this post from digg.com today, there's a pointer to this tutorial from Icemelon.com today about creating dynamic images in PHP.

If you frequent forums, you'd probably remember images in people's signatures that would display information about your computer. Such mysticism! This tutorial will teach you that, and more!

They show you step by step how to use the GD extension in PHP to update a pre-existing image (a PNG in this case) with the viewer's IP address dynamically. It's just a small bit of what you can do with GD, but it's a good introduction to what it looks like...

0 comments voice your opinion now!
tutorial dyanmic images gd png tutorial dyanmic images gd png



Community Events





Don't see your event here?
Let us know!


language opinion release framework api bugfix series tips symfony interview list library introduction threedevsandamaybe laravel developer podcast deployment community zendserver

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework