# Custom Module with embeded view
Documentation on how to use a controller to embed a view in a custom module.
## Reference
[Render a Drupal 8 View programmatically (Render arrays FTW!)](https://www.computerminds.co.uk/articles/render-drupal-8-view-programmatically-render-arrays-ftw)
<?php
namespace Drupal\views_template\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Defines ViewsTest class.
*/
class ViewsController extends ControllerBase {
/**
* Display the markup.
*
* @return array
* Return markup array.
*/
public function content() {
return [
'#type' => 'view',
'#name' => 'view_testing',
'#display_id' => 'embed_1',
];
}
}
// '#type' => 'view' is the magic that lets Drupal's rendering system know that this array represents a view to render.
// '#name' is the machine name of the view you want to render.
// '#display_id' is the display ID within the view to render. You can find the machine name for this in /admin/structure/views/your_view under the Advanced grouping.
// '#arguments' is an optionally array of arguments to pass to the view.