junkins/prefix-registry

There is no license information available for the latest version (dev-master) of this package.

CakePHP PrefixRegistry

dev-master 2016-12-28 13:54 UTC

This package is auto-updated.

Last update: 2024-05-29 03:33:26 UTC


README

Introduction

You can lay Components and Helpers hierarchically.

Setup

Components

<?php
namespace App\Controller\Admin;

use Cake\Controller\Controller;
use PrefixRegistry\Controller\PrefixComponentRegistry;

class AppController extends Controller
{

    /**
     * initialize
     */
    public function initialize()
    {
        parent::initialize();
        // you can use Components definded on
        // '/src/Controller/Component/Admin/*' OR '/src/Controller/Component/*'.
        $this->_components = new PrefixComponentRegistry($this);
    }
}

Helpers

<?php
namespace App\View\Admin;

use Cake\View\View;
use PrefixRegistry\View\PrefixHelperRegistry;

class AdminView extends View
{
     public function initialize()
     {
         parent::initialize();
         // you can use Helpers definded on
         // '/src/View/Helper/Admin/*' OR '/src/View/Helper/*'.
         $this->_helpers = new PrefixHelperRegistry($this);
     }
}