Archived video

This video is archived and won't be updated. We're keeping it online for now as a courtesy.

Alternate resources: 

ReactJS Talks to Your API in Symfony 3

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:11
    Remove the link.
  • 0:13
    In base.html.twig, we already have a few JavaScript files
  • 0:17
    that are included on every page.
  • 0:19
    But now, I want to include some JavaScript on just this page.
  • 0:23
    I don't need this new stuff everywhere.
  • 0:26
    Remember from earlier that those script tags live in a javascripts block.
  • 0:30
    Hey, that's perfect.
  • 0:31
    In the child template, we can override that block,
  • 0:34
    {% block javascripts %} then {% endblock %}.
  • 0:39
    Now, whatever JavaScript we put here

ReactJS Talks to Your API in Symfony 3


In this lesson, you'll learn how to integrate ReactJS into the Twig templates of your Symfony 3 app. You will learn how to include page-specific JavaScript assets, include the ReactJS code, direct ReactJS to use the API you've built in your Symfony app, and generate URLs for dynamic JavaScript assets. With this lesson complete, you will have completed building a rich HTML page and an API endpoint to fuel some sweet JavaScript using Symfony 3.

Ready for more Symfony 3? Check out Symfony 3 Fundamentals: Bundles, Configuration and Environments next!

Log in or sign up to download companion files.
Additional resources: