Jump to content

Set up custom module include theme


Recommended Posts

Hi, I'm creating a new theme by myself, also creating new module related to the theme. When the user installs the theme, I want to install the module automatically.

theme.yml

...
modules:
   to_enable:
     - test123
  hooks:
    modules_to_hook:
      displayHeader:
        - test123
...

test123.php

<?php
class test123 extends Module
{
    public function __construct()
    {
        parent::__construct();
    }
    public function install()
    {
        return true;
    }
}
?>

And I got an error when I try to install the theme.

- test123 failed to perform load module action. The module is invalid and cannot be loaded.

 

How can I solve this?

Link to comment
Share on other sites

  • 2 years 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...