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:
Yii 2.0 ActiveRecord Explained
November 20, 2014 @ 09:08:31

The SitePoint PHP blog has a new tutorial posted introducing you to using ActiveRecord in the Yii2 framework to access the information in your databases. The Active Record design pattern where a single object corresponds to a record in the database (and can be manipulated as such).

The ActiveRecord class in Yii provides an object oriented interface (aka ORM) for accessing database stored data. Similar structures can be found in most modern frameworks like Laravel, CodeIgniter, Symfony and Ruby. Today, we'll go over the implementation in Yii 2.0 and I'll show you some of the more advanced features of it.

He introduces the "Model" class first, the based of the ActiveRecord handling, and its parts: attributes, validation and scenarios. He then gets into the creation of the a model instance based off of a table (SQL structure provided) around authors and articles. He includes the code showing how to create a simple model, add in relations and putting it to use. He also shows how to use the built in "find" handling to locate records. Finally he gets into some of the more advanced topics including checking if attributes are "dirty", the "arrayable" functionality and using events/behaviors/transactions on the models.

0 comments voice your opinion now!
yii2 framework activerecord tutorial introduction

Link: http://www.sitepoint.com/yii-2-0-activerecord-explained/

SitePoint PHP Blog:
Introducing OctoberCMS - a Laravel-based CMS
November 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.

0 comments voice your opinion now!
octobercms laravel introduction cms content management system

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

Matt Stauffer:
Introducing Laravel Homestead 2.0
November 17, 2014 @ 10:41:45

In his latest post Matt Stauffer has posted a guide to the latest release of the Laravel Homestead project, version 2.0, walking you through the installation, configuration and validation of this virtual machine.

When Laravel Homestead first came out, it was a Github repository that included a base Homestead.yaml by default. There was no prescribed place to install it, no global commands for accessing the box, and any time you actually customized your Homestead.yaml file you instantly dirtied your Homestead Github clone, making upgrading difficult.

You can guess where I'm going with this. All of these things are problems no more. The latest version of the Homestead ecosystem has just been released, and it's moved Homestead into a globally installable Composer package which copies Homestead.yaml (and any other user-editable files) into ~/.homestead on your machine.

He covers the two different ways you'd get this updated version - the fresh install (no previous VM installed) and the upgrade path. For each all of the commands and configuration updates you'll need are included. He also points out some of the new features and handling as he goes along.

0 comments voice your opinion now!
laravel homestead version introduction install configure setup tutorial

Link: http://mattstauffer.co/blog/introducing-laravel-homestead-2.0

Dutch Web Alliance:
Docker & PHP beyond virtual machines
November 13, 2014 @ 13:09:21

On the Dutch Web Alliance site there's a recent post from Michael Rook introducing you to using Docker with PHP. Docker is a configurable system allowing you to script the creation and setup of an environment, piecing software and components together in an easy, reproducible way.

Docker is currently one of the hottest technologies around, because it solves a very specific problem: the ability to easily package and deploy a (self contained) application, without the overhead of traditional virtualization solutions. In this post you'll learn how to build, run and host Docker containers, integrate with other containers, and see how Vagrant interacts with Docker.

The post walks you through the steps you'll need to get an instance up and running with PHP setup and configured:

  • Installing Docker
  • Creating and starting a container
  • Dependencies: linking containers
  • Using Docker & Vagrant

In the end, you'll have a virtual instance and environment with PHP installed. All commands and configuration/code needed is included in the post.

0 comments voice your opinion now!
virtual machine docker tutorial introduction vagrant

Link: https://dutchweballiance.nl/techblog/docker-and-php-beyond-virtual-machines/

SitePoint PHP Blog:
Re-introducing FuelPHP
November 10, 2014 @ 10:51:23

On the SitePoint PHP blog today they've posted a new tutorial that reintroduces you to FuelPHP, the framework that was (sort of) the successor to the CodeIgniter framework. It was started by some of the ex-CI developers in an effort to make a more robust, yet simple PHP framework for PHP 5.3+.

As a PHP developer, I have been a consistent user of different PHP frameworks, mostly focusing on CakePHP. Recently, I felt the need to go framework shopping and I have many valid reasons for choosing FuelPHP. It has a built-in modular structure and complete flexibility with emphasis on community. Before Fuel, I was a CakePHP user and just like Cake, Fuel is a huge community driven framework.

The author walks you through the installation process (via the framework's own "oil" command line tool) and dives into some example code quickly after that. He shows how to create a simple "Hello World" route and generate the scaffolding (code generation for the MVC pieces) including migrations. He creates a simple "users" table and adds some authentication checking to the controller. Then in the view he sets up a simple login form, requesting username and password and outputting any errors that might pop up during the authentication process.

0 comments voice your opinion now!
fuelphp framework introduction mvc authentication example

Link: http://www.sitepoint.com/re-introducing-fuelphp/

Liip Blog:
Functional Programming in PHP
November 06, 2014 @ 12:20:35

On the Liip blog today there's a tutorial from Gilles Crettenand giving you an overview of functional programming in PHP. While PHP is not normally used as a functional language, it is possible to simulate the same effect.

Functional programming has gained a lot of traction those 3 to 5 last years. [...] Those [frameworks and languages] are all cool and shiny new toys, but we can benefit from some techniques without having to learn a new tool, just by applying some principles to our everyday PHP! But first of all, what exactly is functional programing?

He starts off with some of the basics of functional programming, some of the difficulties that can come with it and, of course, the advantages it can provide. From here he starts in with code examples. He shows how functions become "first-class citizens" and how they can be applied to various elements. He illustrates this with a few array manipulation examples. Next up are "utility functions" for evaluating the data given (like "any" or "all"). He ends the post looking at the idea of "memoization", or the caching of the results of function calls against data. He shows how to accomplish this with static local variables in PHP and includes a wrapper you can pass any callable function into and have the results cache automatically.

0 comments voice your opinion now!
functional programming introduction language function cache

Link: http://blog.liip.ch/archive/2014/11/05/functional-programing-in-php.html

SitePoint PHP Blog:
Getting Started with Symfony2 Route Annotations
November 06, 2014 @ 09:27:25

On the SitePoint PHP blog today there's a new tutorial posted that gets into the details on one of the powerful (and most used) components of the Symfony framework, the Router, and how to interact with it via annotations. Symfony's route annotations allow you to define functionality at the controller level or via a YAML configuration file.

When you download the Standard Symfony 2 Distribution, it includes an interesting bundle named SensioFrameworkExtraBundle which implements a lot of great stuff, especially the opportunity to use annotations directly within your controllers. The idea behind this article is not to convice developers to embrace this way of doing, but to point the finger at an alternative method to easily configure controllers. Keep in mind that there is no magic recipe, it depends on what you need in each specific scenario. Symfony 2 implements a strong built-in component to manage all the routes of an application: the Routing Component. Basically, a route maps a URL to a controller action.

His example sets up a simple blog and compares the two ways of configuring the routing: one side putting it all in the YAML configuration and the other in the controller docblocks (annotations) themselves. He adds a base page for showing the listing of posts and a single article route, complete with slugs. He also shows how to add in some additional configuration handling to do things like set default values, making things required and enforcing the HTTP method on the request (GET, POST, PUT, etc)

0 comments voice your opinion now!
route annotations introduction docblock tutorial yaml configuration settings

Link: http://www.sitepoint.com/getting-started-symfony2-route-annotations/

SitePoint PHP Blog:
Bower vs BowerPHP
November 04, 2014 @ 09:28:44

The SitePoint PHP blog has a new post today from editor Bruno Skvorc comparing two (almost) identical technologies - Bower and BowerPHP. The main different between the two? One is written in Javascript (Node.js) and the other is, surprise, in PHP. The Bower system is a dependency manager, originally for Node.js environments.

On October 28th, 2014, puppies all over the world spontaneously burst into flames - or so the community would have you believe. What happened was the reveal of BowerPHP (I shy from calling anything "alpha" a release), and here's why it wasn't anything nearly as apocalyptic as some would have you believe. BowerPHP is a PHP version of Bower, the NodeJS based front end package manager. We covered Bower before somewhat, but in essence, you use it to install front end libraries like jQuery, Angular or Foundation much in the same way you use Composer for PHP dependencies. You define a Bower file with dependencies, run bower install, and watch the magic happen.

He goes on to talk about what kinds of problems having the same tool in PHP solves and how to get it installed in your application (via Composer). He then includes an example of it in use installing a copy of the Foundation JS libraries and the resulting output HTML page. He finishes the post with a few reasons "why it's awesome" including there not being a need for yet another technology (Node) and that it's easy to install.

0 comments voice your opinion now!
bower package manager bowerphp library tutorial introduction

Link: http://www.sitepoint.com/bower-vs-bowerphp/

NetTuts.com:
Programming with Yii2 Getting Started
October 31, 2014 @ 10:51:23

On the NetTuts.com site today Jeff Reifman has kicked off a new series of posts introducing you to the Yii2 framework and what it has to offer. In this first post he starts with the basics - installation, setup and configuration of a Yii2 application.

This tutorial will walk you through installing Yii 2.0, setting up your local development environment, building a simple Hello World application, setting up your remote production environment for hosting and deploying your code from a GitHub repository.

He walks you through the install process, via Composer, and creating a new project, the "Hello World". The tutorial also helps you set up a local development environment with MAMP and what the resulting page should look like when loaded. He then gets into some of the architecture of a Yii-based application and starts in on the "Hello World" controllers and views. He finishes the post with a look at setting up a remote server (not localhost) and pushing the application out, complete with commands for server setup and software configuration (like Apache).

0 comments voice your opinion now!
yii2 introduction tutorial programming series part1

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-getting-started--cms-22440

SitePoint PHP Blog:
5 Easy Ways to Get Started with PHP on Vagrant
October 30, 2014 @ 10:44:49

On the SitePoint PHP blog there's a new tutorial showing you how to get started with Vagrant and PHP to create easier, more flexible development environments via virtual machines.

Vagrant is a tool for creating and managing virtual environments that help many developers not have to care about the "works on my machine…" problem. Vagrant creates reusable development systems that can be used again and again, helping you keep your system clean of too many installations.

They offer "five easy ways" to get started including various tools and services:

You can find summaries about each of the items on the list as well as links to more information in the full post.

0 comments voice your opinion now!
vagrant introduction getstarted service tool virtualmachine vm development

Link: http://www.sitepoint.com/5-easy-ways-getting-started-php-vagrant/


Community Events





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


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

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