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

SitePoint PHP Blog:
Getting Started with FigDice
November 21, 2014 @ 12:19:12

The SitePoint PHP blog has posted the second part of their series highlighting the FigDice template rendering system. In this latest article Lukas White focuses on FigDice's ability to "pull" data into templates as needed rather than having it injected.

Amongst the many templating systems out there, most work in pretty much the same way; variables are "injected" using some syntax or another, be it curly braces, percentage signs or whatever that library's convention happens to be. They'll usually have basic control structures, such as if...then and, of course, iteration. FigDice, however, takes an altogether different approach. Inspired by PHPTAL - the subject of a future article - it gives the view layer the responsibility of "pulling" in the data it requires, rather than relying on controllers to assemble and "push" it into the templates.

He walks you through the installation of the tool (via Composer) and how to create a basic FigDice view to work with (including template loading). He uses a sample Silex-based application for his examples, making a layout with the FigDice additions to the attributes. He then shows how to make the template for the main index page with a "mute" region for the include logic. He shows how to include this basic template into the view and render it directly as output. Next he shows how to integrate data with the template, pulling in "tweets" from an array dataset via a loop (walk) and a factory to provide the template the data.

0 comments voice your opinion now!
figdice template tutorial series part2 data integration

Link: http://www.sitepoint.com/getting-started-figdice/

Hari KT:
Aura Input Form Inside Slim Framework
September 08, 2014 @ 10:55:13

Hari KT has a new post to his site today showing how you can integrate the Aura PHP components into a Slim framework application for input handling, like from a form. Aura PHP is a set of decoupled components for things like CLI handling, dependency injection and SQL requests (among others).

Rob Allen wrote about Integrating ZF2 forms into Slim. I did write how you can use Aura.Input and Aura.Html to create standalone form for PHP. This time I felt I should write about integrating aura input inside Slim.

He includes the Composer configuration to install the HTML and Input components as well as an up-to-date version of the Slim framework. Code showing how to create the form class (a "Contact form") is included, showing both the creation of the elements and the filtering/validation checks put on each. He shows how the Slim routes would handle the request as well as how the view processes the request and displays the form via a helper. You can get the full working code in this repository over on GitHub.

0 comments voice your opinion now!
auraphp framework slim form input html tutorial

Link: http://harikt.com/blog/2014/09/02/aura-input-form-inside-slim-framework/

Sanisoft Blog:
Themes in CakePHP 3, A step by step HowTo
August 21, 2014 @ 11:45:38

On the Sanisoft blog there's a recent post that gives you a step-by-step guide to working with themes in the upcoming version 3 release of the CakePHP framework.

Almost every application I code has themes which either the end user can change or the admin can set or can be changed on the fly. Doing all these things was easy in CakePHP 2.x. With the first alpha release of CakePHP 3.x I was naturally keen to try out how theming worked with V3.

He shows how to convert an existing theme into one that will be compatible with the 3.x version of the framework. He breaks it down into seven steps (well, technically eight) to make it easier to follow along:

  • Step 0: Make the "posts" table
  • Step 1: Bake the model, controller and views for the Posts
  • Step 2: Bake in the "Twit" plugin
  • Step 3: Download and install the Twitter Bootstrap
  • Step 4: Create the "default.ctp" file with the content given
  • Step 5: Make the "index.ctp" template with the given content
  • Step 6: Add the line to the AppController to use the new theme
  • Step 7: Reload and verify the results
0 comments voice your opinion now!
theme cakephp framework version3 update template

Link: http://www.sanisoft.com/blog/2014/07/21/themes-in-cakephp-3-howto/

php[architect]:
Sending HTML Emails with Drupal 7, Webform, and Mandrill
July 21, 2014 @ 12:42:45

The php[architect] site has a new tutorial posted giving you a step by step guide to sending HTML email with the combination of Drupal 7, Webform and Mandrill (the mail service by Mailchimp).

By default, Drupal is configured to send out plain text emails. For many developers, plain text email is sufficient and preferable to HTML email. HTML email is still, in this day and age, not guaranteed to render the same across email clients, more likely to be labeled as spam, and requires a significant amount of testing to make sure it works. Still, a minimally styled HTML message can be easier for recipients to read and help reinforce your brand/design (if you don't depend on images to do so). In this article, we'll look at the modules to install and configure to enable HTML emails and, specifically, how to change the default Webform email template to send submissions as HTML.

The tutorial comes in four different sections, each with plenty of description and some code to make it happen:

  • Set up your site to send email
  • Allow outgoing email to use HTML
  • Formatting Outgoing Email
  • Send Webform Submission as HTML Emails
0 comments voice your opinion now!
tutorial html email mandrill drupal7 webform

Link: http://www.phparch.com/2014/07/sending-html-emails-with-drupal-7-webform-and-mandrill/

NetTuts.com:
Working With Templates in Symfony 2
May 20, 2014 @ 10:34:05

NetTuts.com continues their introductory screencast series today with the latest episode focusing on using templates in Symfony 2. Other parts of the series have looked at using controllers, routing and some of the basics of the framework.

Today, let's learn about Symfony 2's Twig Templates. With Twig, you can seamlessly and painlessly integrate your PHP and HTML together, giving you a very clean looking presentation of your view code, without all the clutter of PHP tags, an overabundance of parenthesis, or semicolons. Instead, we have a simple and elegant syntax that we can use.

The screencast works with a sample application and a bundle to render the Twig template and includes examples of defining blocks of content and extending other templates. They also show you how to use layouts and pass data out to the template to be rendered on load. You can watch the screencast in-page or over on YouTube.

0 comments voice your opinion now!
introduction symfony2 template twig screencast series

Link: http://code.tutsplus.com/tutorials/working-with-templates-in-symfony-2--cms-21172

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/

NetTuts.com:
Sending Emails With Laravel 4 & Gmail
December 18, 2013 @ 11:57:25

NetTuts.com has posted a new tutorial today showing you how to use Laravel 4 and Gmail together to send emails from your application. It uses Laravel's own mail functionality, so there's no additional libraries to download.

Sending emails is crucial for any web application. Usually, an email is sent to notify the user of some kind of activity that has taken place on the site, for example, such as when updates have been made or when new friends have been found. In this short tutorial, I'll show you how to send emails with Gmail quickly from within a Laravel sample application by extending the functionality that we built in my last tutorial, Authentication With Laravel 4.

They show you how to set up the mail configuration to correctly point to the Gmail STMP servers using your own Gmail username/password (or one you've set up for the application). Some sample code is included showing how to send an email once the user has registered. Also included is an example of using Laravel's own templating to build the contents of the email.

0 comments voice your opinion now!
send email tutorial gmail laravel template

Link: http://net.tutsplus.com/tutorials/php/sending-emails-with-laravel-4-gmail/

NetTuts.com:
Statamic 101
December 11, 2013 @ 10:40:41

NetTuts.com has a new tutorial posted today introducing you to Statamic, a PHP-based content management system that uses flat-files instead of database entries to manage its content. (One note, Statamic is not free software and there's no "trial" version)

Statamic is a modern PHP CMS which really makes an effort to be easy and intuitive to use. From its flat-file design to its use of technologies, like markdown and Yaml, you can accomplish an outstanding amount of work without writing any code at all. In this article we will take a look at the process from installation to setting up a basic portfolio.

The CMS (downloadable here) has a simpler structure than some other systems as most of the content is just files in the "_content" directory. They talk some about the directory structure of the tool and help you get things configured via the main YAML config. The post then moves on to working with themes and how to get dynamic content in a basic layout. From there they go on to talk about making new content, adding entries and various other topics like administration and templating.

0 comments voice your opinion now!
statamic cms introduction file markdown template layout content

Link: http://net.tutsplus.com/tutorials/php/statamic-101

SitePoint PHP Blog:
How to Dynamically Localize TinyMCE
December 02, 2013 @ 10:37:41

The SitePoint PHP blog has a post from Roland Clemenceau about localizing the TinyMCE editor, a web-based Javascript HTML WYSIWYG editor. It's dropped in to make textareas rich-text editing components of your page quickly and easily.

This tutorial assumes you have built a PHP multilingual site/framework and you, or whoever the admin is, would like TinyMCE to automatically switch to the current language of your site. [...] Although TinyMCE is a great wysiwyg editor that provides localized files for almost every known language, it still does not come with an automatic language-switching feature. It's very easy to roll your own solution to this problem, though, so that's what we're going to do now.

He shows how to use extra language files in coordination with a "language" setting. This setting (usually something like "en" or "es") can then be set as a configuration option when the TinyMCE instance is added to the page.

0 comments voice your opinion now!
localize tinymce editor wysiwyg tutorial html

Link: http://www.sitepoint.com/dynamically-localize-tinymce/

SitePoint PHP Blog:
Using PHP Streams Effectively
November 21, 2013 @ 11:54:02

Vito Tardia has a new tutorial posted to the SitePoint PHP blog today showing you how to use PHP streams effectively, a continuation of his streams series started here.

n my previous article we've discovered the basics of PHP Streams and how powerful they were. In this tutorial we are going to use this power in the real world. First I'll show you how to build your custom filters and attach them to a stream, then we'll package our filters inside a document parser application.

He starts out by introducing the concept of filters in streams - bits of code that can be attached to the stream to perform operations on the data traveling through it. He includes a simple base64 encoding example with a fopen call to illustrate. He gets into more complex filtering by creating a Markdown filter capable of translating the incoming Markdown-formatted data into a document using the MarkdownExtra library. He also includes an example of another filter added on post-Markdown conversion, a Template filter using the RainTPL templating library.

0 comments voice your opinion now!
using streams filter markdown template tutorial

Link: http://www.sitepoint.com/using-php-streams-effectively/


Community Events





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


interview library voicesoftheelephpant introduction podcast composer laravel opinion language series install framework tool community security update version package release symfony

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