You searched for symfony

  1. Symfony in Drupal 8

    If you are a Drupaler, you must be aware that Drupal 8 is on the way. What you may not know is that it includes a few important Symfony components. Working with Drupal 8.x will give Drupalers an opportunity to become a part of a massive learning curve and is going to tempt them to know more about
  2. Building and Processing Forms in Symfony 2

    In this tutorial we will look at two examples of using forms in Symfony 2. In the the first, we will place form elements straight in the View file and then handle the form processing manually in the controller. In the second, we’ll use the Symfony form system to declare forms in an object oriented
  3. How to Deploy Symfony Apps with Capifony

    Say you have a Symfony application. At some point, you would like to deploy it to your server and show it to the world. Of course, you can do it all manually, but these days you can also choose to use a tool like Capifony. If you have developed Ruby applications in the past, you are perhaps
  4. Symfony 2 Checklist for Development and Deployment

    In my Building a Personal Web App Head To Toe With Symfony 2 series published on Sitepoint, I have covered some basics in bootstrapping, development and finalizing (on some advanced techniques) to use Symfony 2 to develop a web application. However, due to the length limitation of the series, we
  5. Building an Ad Manager in Symfony 2

    Just this once won’t hurt - I am not going to write about Sass but Symfony. I had to do a little bit of backend at work and ended up with an interesting problem to solve, involving quite a lot of things so I thought it wouldn’t be such a bad idea to write an article about it. But first, let
  6. Learn symfony: a Beginner's Tutorial

    With the release of symfony 1.0, it's time for those who haven't tried it yet to see what's inside this beautiful framework. Stable, fully documented, and released under the open-source MIT license, symfony is used by hundreds of web sites, including some very large ones (Yahoo! Bookmarks, with its
  7. Drupal 8 Hooks and the Symfony Event Dispatcher

    With the incorporation of many Symfony components into Drupal in its 8th version, we are seeing a shift away from many Drupalisms towards more modern PHP architectural decisions. For example, the both loved and hated hook system is getting slowly replaced. Plugins and annotations are taking away
  8. Build your own PHP Framework with Symfony Components

    You’ve probably met Symfony in your PHP career - or have at least heard of it. What you may not know is that Symfony is, at its core, composed of separate libraries called components, which can be reused in any PHP application. For example, the popular PHP framework Laravel was developed using
  9. Integrating Polymer/Dart and Symfony - Part 1

    My first four articles for SitePoint are devoted to Symfony (my favorite PHP framework) and Dart (my favorite HTML 5 development tool). In this 2-part series, we are going to look at how to integrate these two powerful tools together, i.e. to run Dart (after compiling to JavaScript) in a Symfony
  10. Understanding Symfony Bundle Configuration and Service Container

    In this post we’ll cover different ways on how to configure Bundles in Symfony2 and how the dependency injection container works with the configuration. The Bundle configuration and Symfony dependency injection container (also known as service container) can be difficult concepts to grasp when
  11. Integrating Polymer/Dart and Symfony - Part 2

    In the previous article, we implemented a Dart widget in our Symfony app. Let's handle the rest now. This might get advanced, so grab a cup of coffee and pay close attention - I recommend you follow along only after completing Part 1! Get around JSONP and display an Object's member
  12. Symfony Translation: Internationalization Made Easy

    . If no matching translation is found, the original string is returned. Translations are not typically done by programmers. Instead they are done by professional translators. Translators may not have programming knowledge and we may not want to give them code. Luckily, Symfony can use different loaders from
  13. Building a Web App With Symfony 2: Development

    In Part 1, I have shown you how to set up Symfony 2 and link up the database. We also covered some fundamental concepts of the framework. In this part, we will link things up by creating routes, controllers, entities/repositories, and views to get the site up and running. Routes Our instance
  14. Building a Web App with Symfony 2: Bootstrapping

    Introduction The Symfony PHP Framework is powerful, scalable and flexible. Yet it is considered by many, especially those new to frameworks, to have a very steep learning curve. This is true to a certain extent. At first glance, Models, Views, Controllers, Entities, Repositories, Routing
  15. Command line PHP using Symfony Console

    . Nowadays building command line scripts is much easier than it used to be. If you search on Packagist you will find a lot of packages to work with the command line but the one that stands out and is the most commonly used is Symfony/Console. Symfony/Console is a stand alone package that was developed
  16. Building a Web App with Symfony 2: Finalizing

    In Part 1 and Part 2 of this series, I have covered the basics of using Symfony 2 to develop a functioning web site. In this part of the tutorial, I will cover some more advanced techniques and finish the project with pagination, image watermarks and NativeQuery. The code we'll be using
  17. Getting Started with Symfony2 Route Annotations

    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
  18. Image Scraping with Symfony's DomCrawler

    ; } setFileName provides an option to change the name of the ZIP file with a default name set to zipImages: public function setFileName($name = "zipImages") { $this->fileName = $name; } At this point, we instantiate the Symfony crawler component to search for images, then download and save all
  19. 9 reasons to consider eZ Publish CMS for your next web project

    Introduction With the recent refactoring of eZ Publish content management system as a full stack Symfony application it should be interesting for a broader PHP public to consider it as a content management solution. We at Netgen have been using it for almost a decade and would like to share our
  20. Building a Drupal 8 Module: Blocks and Forms

    In the first installment of this article series on Drupal 8 module development we started with the basics. We’ve seen what files were needed to let Drupal know about our module, how the routing process works and how to create menu links programatically as configuration.

    In this tutorial we are going to go a bit further with our sandbox module found in this repository and look at two new important pieces of functionality: blocks and forms. To this end, we will create a custom block that returns some configurable text. After that, we will create a simple form used to print out user submitted values to the screen.

    Drupal 8 blocks

    A cool new change to the block API in D8 has been a switch to making blocks more prominent, by making them plugins (a brand new concept). What this means is that they are reusable pieces of functionality (under the hood) as you can now create a block in the UI and reuse it across the site - you are no longer limited to using a block only one time.

    Let’s go ahead and create a simple block type that prints to the screen Hello World! by default. All we need to work with is one class file located in the src/Plugin/Block folder of our module’s root directory. Let’s call our new block type DemoBlock, and naturally it needs to reside in a file called DemoBlock.php. Inside this file, we can start with the following:

    namespace Drupal\demo\Plugin\Block;
    use Drupal\block\BlockBase;
    use Drupal\Core\Session\AccountInterface;
     * Provides a 'Demo' block.
     * @Block(
     *   id = "demo_block",
     *   admin_label = @Translation("Demo block"),
     * )
    class DemoBlock extends BlockBase {
       * {@inheritdoc}
      public function build() {    
        return array(
          '#markup' => $this->t('Hello World!'),
       * {@inheritdoc}
      public function access(AccountInterface $account) {
        return $account->hasPermission('access content');

    Like with all other class files we start by namespacing our class. Then we use the BlockBase class so that we can extend it, as well as the AccountInterface class so that we can get access to the currently logged in user. Then follows something you definitely have not seen in Drupal 7: annotations.

  21. Autogenerate CRUD Apps with Phreeze

    Back in the times of Symfony 1.x, the framework had a powerful backend module to help the developers and site administrators create a good enough app and provide necessary CRUD features to manage the database (and save us from using PHPMyAdmin). Since Symfony 2, this has been taken out from