Viewing posts tagged PHP

Just Released: Docker, Symfony 4, Composer, and Form API Tutorials

This week, we've published more tutorials for our Drupal Development with Docker series, a new video series from KnpUniversity that will get you up and running with Symfony 4, a brand new set of tutorials: Introduction to Composer for Drupal Users, and another Form API tutorial.

Drupal 8 Prep: Inheritance, Abstraction, and Interfaces in PHP

In this series, Object-Oriented PHP Part 3, we'll teach you all about inheritance in PHP, including how that works in classes, abstractions, and interfaces. These concepts are keys to understanding the code you will see in Drupal 8 modules.

Drupalize.Me Is Going to ZendCon

We'll be attending ZendCon 2015 this week, learning about what the PHP community is up to, and sharing our Drupal knowledge.

Dynamically Access PHP Object Properties with $this

Sometimes we need to be able to retrieve the value of a property on an object, but we don't know the name of that property. Instead, we need to dynamically calculate the property name, and then access the value. For example: $row->{$my_property};. This post looks at how the Views module uses this technique and allows for a huge amount of flexibility.

Release Day: Object-Oriented PHP Part 2

We've recently switched from weekly releases to working towards releasing an entire series all on the same day. The Object-Oriented PHP Part 2 series is the first one we're doing with this. You get access to the complete series today! This second part of three on object-oriented PHP, provided by KnpUniversity, continues on from our Introduction to Object-Oriented PHP series.

PHP Classes and Objects

Object-oriented programming (OOP) is way of organizing your code to be more efficient, and it takes advantage of some really nice features in modern versions of PHP. One of the basic concepts of OOP is, not surprisingly, an object. Directly related to working with objects is understanding PHP classes. Drupal 8 is taking big steps to move to an OOP architecture, and so you will get very familiar with both of these as you start to jump into Drupal 8 development.

This tutorial, based on the video Create a Basic PHP Class, will explain what a class is, show you how to set up a class, and look at a PHP object. By the end of this tutorial, you will be able to create a class, an object, add a property to your object, and set the value of the property inside the class.

Release Day: Access Control, Type Hinting, and Constructors in PHP

This week, we're wrapping up our series, Introduction to Object-oriented PHP, in partnership with KnpUniversity, with tutorials on access control for properties, type hinting, and constructors in PHP.

Release Day: Working with PHP Objects

This week, we continue our Introduction to Object-oriented PHP series, in partnership with KnpUniversity (now SymfonyCasts), with tutorials that mostly focus on working with objects in PHP. You'll also learn how to add a specially formatted comment to your code that will enable code autocomplete functionality in your IDE.

Release Day: Introduction to Object-oriented PHP

In anticipation of the release of Drupal 8, one of the things we think is important is to provide foundational training material in areas related to the changes in Drupal 8. One major change is the shift to an object-oriented PHP (OO PHP) architecture, which you can learn more about here, in my presentation, What's New in Drupal 8: Object-oriented PHP. To provide a hands-on coding introduction to OO PHP, we worked with our partners at KnpUniversity to create a new series. Today we are delighted to release the first four video tutorials in the new KnpUniversity series, Introduction to Object-Oriented PHP.

A Peek at Traits in Drupal 8

Part of learning Drupal’s API is learning about “what’s in the pantry.” In Drupal 8, that pantry is configured quite a bit differently than before. Instead of getting the whole warehouse of Drupal functions on every page load, functions—well, now methods—are contained in objects which are defined by classes. Most, if not all, of these classes, which exist in their own PHP files, can be extended and many of them are specifically designed to be extended. These extensible classes are the pantries. They contain properties and methods that we can just use in the classes that extend them. When we extend these classes, we need to make sure we peek inside to see what’s available before we go elsewhere for something that might already be in the cupboard.

Release Day: Wrapping up PHP Part 3

We've covered a lot of material in the three parts of PHP for Beginners. Today we are wrapping up Part 3, on databases. This week's tutorials are more focused on the PHP side of things, taking a look at PHP function arguments and query parameters, along with an example of how PHP function scope works. We finish up this series with a very important lesson on SQL injection attacks, and how to make your PHP database code secure.

Release Day: MySQL with PHP and Some Bonus YAML

This week we're continuing PHP for Beginners Part 3 , which is working with databases in PHP. Last week, we started off my covering the fundamentals of SQL and working with a MySQL database. Today we hook this up with the PHP site we're building. Additionally, we have a bonnus lesson YAML.