Jump to content

Prestashop 1.7 $this->l(''); blocks module


Recommended Posts

Hello. I'm trying to port my PS1.6 module to PS1.7

My module is blocked by this code line:

class AdminMymoduleController extends ModuleAdminController {
public function __construct() {
    $this->meta_title = $this->l('whatever');

If I remove the $this->l('whatever')


$this->meta_title = 'whatever';

It works.



Has something changed or is this a bug?

Edited by catalin.pop (see edit history)
Link to comment
Share on other sites

Yes. I saw that too. Same effect.


The funny thing is that in the same class I have

    public function initToolBarTitle() {
        $this->toolbar_title[] = $this->l('Toolbar title');

And it's working


did you trying?

$this->trans('whatever', array(), 'Modules.Modulename.Admin')

Read more on: http://developers.prestashop.com/module/05-CreatingAPrestaShop17Module/06-ModuleTranslation.html

Link to comment
Share on other sites

what exactly do you mean by 'blocks module'?  Is there a specific error you are receiving?


Also, in the future do not say 1.7, there are already 6 different versions, so be more specific.


function l still exists in the AdminController class, so you can still use it.  maybe you can't use it on the __construct function

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