Skip to content

Instantly share code, notes, and snippets.

@bangpound
Last active January 1, 2016 15:08
Show Gist options
  • Save bangpound/8161941 to your computer and use it in GitHub Desktop.
Save bangpound/8161941 to your computer and use it in GitHub Desktop.
<?php
namespace Bangpound\Bundle\DrupalBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
/**
* Class CtoolsContentTypesController
* @Route("/ctools")
* @package Bangpound\Bundle\DrupalBundle\Controller
*/
class CtoolsContentTypesController extends Controller
{
public function __construct()
{
ctools_include('content');
}
/**
* @Route("/{type}/{subtype}", name="ctools_content_render")
* @Method({"GET", "POST"})
* @Template
* @param $type
* @param $subtype
* @param array $conf
* @param array $keywords
* @param array $args
* @param array $context
* @param string $incoming_content
* @return array
*/
public function renderAction($type, $subtype, $conf = [], $keywords = array(), $args = array(), $context = array(), $incoming_content = '')
{
$block = ctools_content_render($type, $subtype, $conf, $keywords, $args, $context, $incoming_content);
if ($block) {
return (array) $block;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment