How to Create Controller for PageTemplate?

Permalink
Hi,

I am facing difficulties to create controller for page template, so please share how to create controller for page template.

 
ssrgspdkt replied on at Permalink Reply
ssrgspdkt
Hi
We can't create controller for page template like 5.6. But We could create controller to its page type

We can create page type controller using the following method:
For example you have event_details page template . its page type handle name is event. In this case, we need to create file application\controllers\page_types\Event.php
its code will be like this
<?php
namespace Application\Controller\PageType;
use Concrete\Core\Page\Controller\PageTypeController;
class Event extends PageTypeController
{
    public function view()
    {
        //add required code
    }
}