Jump to content

How to embed Admin Module Controller in Backend


Recommended Posts

Hello,

i have created a admin module with Module generator, added routes and want to use my own Admin Controller which renders a Twig Template.

The Side Link is working but the Controller opens the template without Prestashop Backend around the template.

AdminController without any Logics:

<?php

namespace EasyUpload\Controller;

use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController;

class DemoController extends FrameworkBundleAdminController
{
    public function demoAction()
    {
        $content = $this->content;
        return $this->render('@Modules/easyupload/views/templates/admin/index.html.twig', [
            'content' => $content
        ]);
    }

    public function getContent()
    {
        /**
         * If values have been submitted in the form, process.
         */
        if (((bool)Tools::isSubmit('submitEasyuploadModule')) == true) {
            $this->postProcess();
        }

        $this->context->smarty->assign('module_dir', $this->_path);

        $output = $this->context->smarty->fetch($this->local_path.'views/templates/admin/configure.tpl');

        return $output;
    }
}

The Result was looking like the result.png attachment. What im expect is like the 2nd picture.

What iam missing to embed my template in the Admin Backend? Any Ideas?

result.png

expect.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...