Creating Custom Pages
In this chapter, we will make custom pages with controllers. A controller is a class that contains a method used to build a page when Drupal is accessed at a specific path. Creating custom pages allows you to extend Drupal beyond just the content pages. This chapter will cover the process of creating custom pages, receiving dynamic values from paths, and serving JSON or file download responses.
In this chapter, we will learn about the following recipes:
- Defining a controller to provide a custom page
- Using route parameters
- Creating a dynamic redirect page
- Creating a JSON response
- Serving files for download