Subscribe to PHP Freaks RSS

CloudWays Blog: Getting Started With Vue.Js In Symfony

syndicated from www.phpdeveloper.org on February 26, 2018

On the CloudWays blog there's a tutorial posted that walks you through the beginning steps to create a Symfony + Vue.js application with a Symfony 4 application.

As a PHP developer who uses Symfony regularly, I have had a hard time choosing from the numerous JavaScript frontend frameworks available in the market. I had to pick one of the top-rated JavaScript frameworks including Angular, React, Vue and Aurelia.

[...] In this article, I will go through the process of enabling and configuring Vue.js within Symfony applications. Part of this process is covered in the official Symfony documentation.

The tutorial starts by answering the "Why Vue?" question and why frontends are important. He then gets into some of the prerequisites and the steps to create the application:

  • creating the Symfony 4 application via Composer
  • adding a default controller and route
  • making a default Vue.js template via Twig
  • pulling in Vue.js and its requirements via yarn
  • creating the Vue Component

The end result is a simple page that shows the component in a Bootstrap-themed page.