2017 © Pedro Peláez
 

library lemo-theme

image

matycz/lemo-theme

  • Thursday, June 23, 2016
  • by MatyCZ
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1,186 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 6 % Grown

The README.md

Lemo\Theme

Lemo\Theme is a Zend Framework 2 module that allows you to switch between various themes. It allows you to create various themes and then switch between them. Themes can be installed in multiple folders., (*1)

The current theme can be defined in global.ini or local.ini for whole application. For the module you can set default theme in module.config.php. You can switch theme from any place in application by ServiceManager from instance of ThemeManager too., (*2)

Installation

Installation of this module uses composer. For composer documentation, please refer to getcomposer.org., (*3)

  1. cd my/project/directory
  2. Create a composer.json file with following contents:, (*4)

    json { "require": { "matycz/lemo-theme": ">=1.0" } }, (*5)

  3. Run php composer.phar install
  4. Open my/project/directory/config/application.config.php and add module name Lemo\Theme into key modules like below:, (*6)

    php return array( ... 'modules' => array( ... 'Lemo\Theme' ... ), ... );, (*7)

Installation without composer is not officially supported, and requires you to install and autoload the dependencies specified in the composer.json., (*8)

Documentation

In configuration files you can set the default theme that should be used, the list of directories that should be used for selecting the current theme as listed bellow:, (*9)

'theme_manager' => array(
    'theme' => 'default',
    'theme_paths' => array(
        './theme/'
    ),
),

To get a basic theme up and running you can just copy the default one from examples/theme folder into the theme folder in application root or create a new one by following the tutorial bellow. Make sure that the theme option is set the the name of your new theme., (*10)

Examples

getThemeManager()->setTheme('foo');

        // Example 2 - Set new theme with name foo
        $this->getServiceLocator()->get('ThemeManager')->setTheme('foor');

        return new ViewModel(array(
            ...
        ));
    }
    
    ...
    
    /**
     * @param  ThemeManagerInterface $themeManager
     * @return BarController
     */
    public function setThemeManager(ThemeManagerInterface $themeManager)
    {
        $this->themeManager = $themeManager;

        return $this;
    }

    /**
     * @return ThemeManagerInterface
     */
    public function getThemeManager()
    {
        return $this->themeManager;
    }
}
```

```php

= $this->theme() ?></p> , (*11)

The Versions

27/07 2015
27/07 2015
16/02 2015
02/02 2015
12/01 2015

1.0.1

1.0.1.0 https://github.com/MatyCZ/LemoTheme

  Sources   Download

BSD-3-Clause

The Requires

 

zf2 theme

12/01 2015

1.0.0

1.0.0.0 https://github.com/MatyCZ/LemoTheme

  Sources   Download

BSD-3-Clause

The Requires

 

zf2 theme