Theming
Topic

PHP for Drupal 7, 8, 9, and 10

PHP: Hypertext Preprocessor (PHP) is an interpreted programming language that is widely used, and especially well suited for web development. Drupal and many other popular web applications are written in PHP. If you wish to develop Drupal modules or be able to do advanced Drupal theming, you will need to learn PHP.

Example tasks

  • Write a custom Drupal module
  • Make modifications to add features or fix bugs in Drupal core or contributed modules
  • Work with other PHP frameworks like Symfony and WordPress or write custom PHP scripts

Confidence

PHP has been around for a long time, so there is a plethora of resources available for learning it. Because most PHP is backwards-compatible with older versions of the language, many older lessons and examples are still relevant today. However, the language has evolved in recent years, introducing new features and best practices, so we recommend always using the latest stable version of PHP and associated best practices when possible.

Drupalize.Me resources

See the recommended external resources below if you need to learn PHP.

Categories
Drupal 8, 9, and 10
More information

Object-oriented PHP utilizes classes and objects to organize code into reusable chunks. This approach helps us organize complex applications, such as Drupal, into modular code called classes that can be reused across the entire system.

Guides

Not sure where to start? Our guides provide useful learning tracks for all skill levels.

Navigate guides

External resources

  • PHP.net (php.net)
    • The official documentation of the PHP project. Especially useful for looking up language features and usage examples.
  • PHP: The Right Way (phptherightway.com)
    • We’re constantly using this as a source to locate information about current PHP best practices.
  • PHP Tutorial Track (symfonycasts.com)
    • Our friends at SymfonyCasts.com offer video courses for newcomers to PHP.