Jump to content

Create Admin Controller


Recommended Posts

So far i've been unsuccessful. i've followed the documentation in https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/ but it isnt working (can't open the link or see it in the modules manager).

 

Can someone help me? Thanks

Quote

<?php
// modules/your-module/src/Controller/DemoController.php

namespace produtosManager\Controller;

use Doctrine\Common\Cache\CacheProvider;
use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController;

class produtosManagerController extends FrameworkBundleAdminController
{
    public function produtosAction()
    {
        // you can also retrieve services directly from the container
        $cache = $this->container->get('doctrine.cache');
        
        return $this->render('@Modules/produtosmanager/templates/admin/produtosmanager.html.twig');
    }
}
 

Quote


{
  "name": "filipe/produtosmanager",
  "description": "takanap",
  "autoload": {
    "psr-4": {
      "produtosManager\\Controllers\\": "src/Controller/"
    }
  },
  "config": {
      "prepend-autoloader": false
  },
  "type": "prestashop-module"
}

 

 

Edited by FilipeSilva11 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

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...