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

SitePoint PHP Blog:
Record Retrieval and Pagination in Bolt CMS
Jun 02, 2015 @ 12:29:59

The SitePoint PHP blog has a new tutorial posted showing you how to set up pagination in the results provided by the Bolt CMS that includes handling to grab content from the database and display the results.

Bolt is a lightweight CMS built on Silex with Symfony components that’s fast, easy, and fun to develop with. My recent affinity for Bolt has turned it into my CMS of choice as I make a conscious effort to choose wisely and step away from bloated frameworks. Previously, I gave a very detailed insight into what it’s like developing with Bolt. Today, we’re going to break down a very popular task into steps in order to accomplish it with ease.

He starts with an installation of the Homestead Improved virtual machine and checks out a new copy of Bolt. He sets up a basic Bootstrap-based theme, including header and footer partial views. He then shows how to create "contenttypes" and fetch the current content records. He updates the Twig template to show the results and integrates the simple pagination. He then creates the single page version to view the content and "previous" and "next" links to accompany it.

tagged: bolt cms tutorial pagination content type management silex

Link: http://www.sitepoint.com/record-retrieval-pagination-bolt-cms/

SitePoint PHP Blog:
How to Use GitHub's API with PHP
Mar 17, 2015 @ 10:11:39

The SitePoint PHP blog has a new tutorial posted showing you how to interact with the GitHub API via PHP thanks to the KnpLabs library to create a simple automation system to perform some simple tasks.

Github is one of the best ways to share code and collaborate. In this article, we are going to learn how to consume their API and how we can use it to accomplish some of our daily tasks. We are going to explore some of the daily tasks that can be accomplished through the Github API and build a small app using Laravel to illustrate the use cases. You can check the final result on Github.

They walk you through the setup of an application on the GitHub side and how to configure the related settings in your Laravel application. He shows how to bind the GitHub library to the app, set up some sample routes and build out controllers to:

  • List repositories
  • View repository content
  • Editing files
  • Viewing commits

Each item includes the code you'll need to make it happen, an example of the output you'll get from the API and how to use the data on your side in your views.

tagged: github api tutorial knplabs repository edit view content commits

Link: http://www.sitepoint.com/use-githubs-api-php/

SitePoint PHP Blog:
CMS Content Organization Structures: Trees vs Facets vs Tags
Feb 05, 2015 @ 11:38:35

In the latest post to the SitePoint PHP blog Lukas Smith takes a look at content management systems comparing trees versus facets versus tags in content organization.

For several years I have been interested in content repositories as a key aspect of modern CMS. With “modern”, I mean CMS that are not just “page management systems” but CMS that actually manage content, thereby enabling authors to reuse their content on different devices and even different applications. But when evaluating [prismic.io and contentful.com], I noticed a surprising trend: they do not leverage trees, neither as a native storage concept nor as a visualization concept. Instead, they for the most part rely on flat structures with tagging. My gut feeling was telling me that this was a mistake, especially when managing larger content repositories. At the same time I wondered: “Am I just a dinosaur that is missing the ark?”.

He starts with an introduction to the concepts of trees, facets and tags and starts in on the advantages and disadvantages of each. For each topic he shares a brief summary of what they are and a screenshot showing how they could be visualized. He finishes the post with a "tl;dr;" summarizing the points made for those wanting the basics.

tagged: cms content organization structure tree facet tag introduction

Link: http://www.sitepoint.com/cms-content-organization-structures-trees-vs-facets-vs-tags/

Design Patterns: The Decorator Pattern
Jan 23, 2015 @ 12:08:21

The NetTuts.com site has continued their series looking at design patterns and how they can be used in PHP. In this new post they focus in on the Decorator pattern, most commonly used to add functionality to a existing class (to "decorate" it).

Earlier in this series we explored both the facade and adapter design patterns in this series. Using facade, we can simplify large systems, and by implementing adapter we can stay safe while working with external API and classes. Now we are going to cover the decorator design pattern, which also falls under the category of structural patterns. We can use the decorator pattern when we just want to give some added responsibility to our base class. This design pattern is a great alternative to a sub‑classing feature for extending functionality with some added advantages.

They start with a problem that needs solving - sending an email with additional content not defined in the parent class. They show how to do something similar with child classes, but quickly find a limitation. Instead, they show how to use decorator classes and a simple interface to provide interchangeable classes that augment the contents of the email body as passed in via constructor injection.

tagged: designpattern decorator tutorial series email body content

Link: http://code.tutsplus.com/tutorials/design-patterns-the-decorator-pattern--cms-22641

December 2014 Issue Released - Taming Content
Dec 17, 2014 @ 11:55:27

php[architect] has posted the official release announcement for the latest edition of their magazine, the December 2014 edition: Taming Content.

The PHP habitat is well stocked with content management systems. Everything from mature projects like Drupal, WordPress, Joomla!, to in-house custom systems (come on, who hasn’t taken a stab at this at least once?). Even if you primarily work with backend applications, it’s good to know the options available for helping clients and coworkers manage and update site content on their own.

This issue includes articles like:

  • Advanced Sites Deserve Advanced Custom Fields (Steve Grunwell)
  • Drupalese 101 (Annika Garbers)
  • ProcessWire: Flexibility, Power, and a Generous Dose of Pure Fun (Teppo Koivula)
  • PHP Tips and Tricks (Julien Pauli)

All of your favorite columns are there too including Laravel tips, the Community Corner and the Education Station. You can check out more information about these and other articles in the page for the issue or just pick up a copy of your own (available in both print and digital formats).

tagged: phparchitect magazine dec2014 issue release taming content

Link: http://www.phparch.com/magazine/2014-2/december/

SitePoint PHP Blog:
7 CRM Options Compatible with Drupal
Dec 11, 2014 @ 09:14:14

The SitePoint PHP blog has posted a list of seven customer relationship management tools (CRM) that play nice with Drupal, a popular PHP-driven content management system.

Whether you want to call Drupal a CMS (Content Management System), a CMF (Content Management Framework) or a CMSomething, the ‘C’ always stands for Content. Content is where Drupal shines and is what it’s designed for. [...] When an organisation is at a stage and mindset that they also want to manage their contacts and interactions effectively they will often need tools designed specifically for that function. These are generally referred to as a CRM, which stands for Client Relationship Manager or Constituent Relationship Manager, depending on the sector (For-Profit or Not-for-Profit respectively)

[...] What has a CRM got to do with Drupal? Nothing directly, but indirectly if you’re looking to streamline your business operations and automate the ways people can interact with you, your CRM will need to work well with your website. [...] In this article, we will look at several of the big players in the CRM space that work well with Drupal, how they integrate or how developers can get them to integrate.

They start with a list of five of the seven options:

  • Roll it yourself
  • RedHen
  • CiviCRM
  • Salesforce
  • Sugar CRM

They also provide a few other options combining a few technologies: Microsoft Dynamics and BlackBaud or Nation Builder and Salsa. Links and a brief summary of the project are included for each item in the list. He ends with a few tips about the actual integration, including the use of the CRM tool's API or using the Migrate Drupal module.

tagged: crm customer relation management tool integrate drupal content

Link: http://www.sitepoint.com/7-crm-options-compatible-drupal/

SitePoint PHP Blog:
Introducing OctoberCMS – a Laravel-based CMS
Nov 19, 2014 @ 09:22:00

On the SitePoint PHP blog there's a recent post taking a closer look at the OctoberCMS, a content management system based on the Laravel framework. In this new post they walk you through what the CMS is, the features it has to offer and help you understand (and add to) the different kinds of elements.

October CMS is a lightweight, back to basics content management system built on Laravel, and on a mission to make your web development workflow easy again. It boasts a very simple and fast learning curve, with a guarantee that you’ll be off the ground and up and running in no time at all. It’s scalable and extensible through the plugin system, is easily maintainable through its file-based system, and allows for the effortless creation of administrative back-end interfaces. Before we dig a bit deeper into this promising CMS, let’s look at the foundation a bit.

They walk you through the install (from their GitHub repository) to get a sample site up and running. The tutorial then goes through each of the basic sections, explaining what they are and providing example code where appropriate:

  • Themes & Templates
  • Pages
  • Partials
  • Layouts
  • Content Blocks
  • the AJAX Module

They also talk about extensibility via plugins and components and link to more information for those looking for more detail.

tagged: octobercms laravel introduction cms content management system

Link: http://www.sitepoint.com/introducing-octobercms-laravel-based-cms/

Sound of Symfony Podcast:
Episode 5 - The no-theme all-content episode
Oct 31, 2014 @ 11:17:13

The Sound of Symfony podcast has released their latest episode - Episode #5: The no-theme all-content episode with hosts Magnus Nordlander and Tobias Nyholm

In this episode we don't have a specific theme. We do however have a lot of fun content for you. We discuss Magnus' trip to Symfony Live New York, the Best Practices document, Blackfire.io (née SensioLabs Profiler) and much more. We also have a long interview with Jordi Boggiano of Composer fame, and two short interviews with Jeremy Mikola and Anne-Sophie Bachelard respectively.

They also talk about the PHPStorm plugin for interaction with SensioLabs Insight, WurstCon and Jordi's Toran Proxy work. You can listen to this latest episode either through the in-page player or by downloading the mp3. If you enjoy the episode, be sure to subscribe to their feed to get the latest episodes as they're released.

tagged: soundofsymfony podcast ep5 theme content jeremymikola annesophiebachelard

Link: http://www.soundofsymfony.com/episode/episode-5/

Paul Jones:
Action-Domain-Responder, Content Negotiation, and Routers
Jul 18, 2014 @ 10:17:57

In his latest post Paul Jones comes back to his proposed application structure, the idea of Action-Domain-Responder, and answers some questions about where content negotiation happens and routing.

While talking about Action-Domain-Responder on the Crafting Code Tour, one of the common questions I got was: “Where does content negotiation happen?” My response was always: “Where does it happen in Model-View-Controller?” That opened up a discussion on how content negotiation is a tricky bit that can go in different places, depending on how you want the concerns separated, and is not a problem specific to ADR.

He goes on and tries to answer the question a bit better, pointing out that "it's a problem for everyone" isn't really good enough to take action on. He works through the different pieces of the ADR pattern, trying to reason out where the right fit is. He suggests a "first filter" on the Controller level, more specifically at the Router level. That's not to say that the Router needs to know about content handling, but it does need to know how to pass that information on.

tagged: action domain responder content negotiation routing

Link: http://paul-m-jones.com/archives/6020

SitePoint PHP Blog:
Memberships with Laravel Cashier
Apr 29, 2014 @ 10:38:51

The SitePoint PHP blog has posted a tutorial for those using the Laravel Cashier showing you how to work with memberships for the content or functionality of your application.

In this tutorial we’re going to see how easy it is to create a basic paid membership website using the Laravel Cashier package. You can see a demo of the app here and download the source code here.

The tutorial walks you through setting up a functional environment and getting the new Laravel instance up and running. Migrations to run are included in the repository checkout too. The tutorial then gets into the setup of Stripe for payments and creation of the various pages you'll need. An "upgrade" option is also included.

tagged: membership laravel cashier tutorial stripe content

Link: http://www.sitepoint.com/memberships-laravel-cashier/