PHPackages                             eom/plugin-cakephp-loadsubcomponents - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. eom/plugin-cakephp-loadsubcomponents

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

eom/plugin-cakephp-loadsubcomponents
====================================

Plugin CakePHP 2.x for Load SubComponents in SubFolders.

v0.2.0(5y ago)158GPL-3.0-onlyPHPPHP &gt;=5.3.0

Since Oct 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/EOM/plugin-cakephp-loadsubcomponents)[ Packagist](https://packagist.org/packages/eom/plugin-cakephp-loadsubcomponents)[ Docs](https://github.com/EOM/plugin-cakephp-loadsubcomponents)[ Fund](https://paypal.me/EOMDesignGroup)[ Patreon](https://www.patreon.com/eom_com_ar)[ RSS](/packages/eom-plugin-cakephp-loadsubcomponents/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

Plugin for CakePHP 2.x is for Load SubComponents
================================================

[](#plugin-for-cakephp-2x-is-for-load-subcomponents)

Con este componente va a poder crear subdirectorios dentro de tu carpeta Controller/Component/.../ y que sean cargados luego sin la limitacion nativa de CakePHP 2.x respecto a este problema.

**1. Instalar con composer:**

Edita tu archivo **composer.json** con los siguientes cambios.

```
  "extra": {
        "installer-paths": {
            "app/Plugin/EOM/{$name}/": ["vendor:eom","type:cakephp-plugin"],
            "app/Plugin/{$name}/": ["type:cakephp-plugin"]
        }
    }
```

Esto puede variar con su **configuracion de CakePHP 2.x** y donde configuraron la carpeta **vendors** para composer. En mi caso, se tomo la siguiente estructura, si tiene otra estructura ajueste el path correcto dentro del archivo **composer.json** `"app/Plugin/EOM/{$name}/": ["vendor:eom","type:cakephp-plugin"]`

**Path Tree:**

```
|-> app
| |-> Plugin
|   |-> ...
|   |-> EOM
|      |-> LoadSubComponents
|   |-> ...
|-> vendors
| |-> bin
| |-> composer
| |-> ...
| |-> autoload.php
```

**2. Configurar bootstrap.php para cargar el plugin**

Despues agregué al final del archivo o juntos a los otros plugins que tenga configurado, la siguiente linea dentro del archivo **app/Config/bootstrap.php**

```
    // Load Plugins ...
    CakePlugin::load('EOM/LoadSubComponents', array('bootstrap' => false, 'routes' => false));
```

**3. Configurar el component de forma global en el AppController**

Como configurar el componente para todo el sistema y cargar otro componentes en una subcarpeta

```
    /**
     * Application Controller
     * @property LoadSubComponentsComponent $LoadSubComponents
     */
    class AppController extends Controller {

        public $components = ['EOM/LoadSubComponents.LoadSubComponents'];
    }
```

**4. Utilizarlos en un controller cualquier que hereda de AppController**

Ejemplo de como utilizar el LoadSubComponents en beforeFilter o una acción.

```
    /**
     * MiDemo Controller
     * @property MiFunctionDemo1Component $MiFunctionDemo1
     * @property MiFunctionDemo2Component $MiFunctionDemo2
     * @property MiFunctionDemo3Component $MiFunctionDemo3
     */
    class MiDemoController extends AppController {

        public function beforeFilter()
        {
                parent::beforeFilter();

                // Load path Controller/Component/SubDirectorios/TestDemoComponent.php
                $this->TestDemo = $this->LoadSubComponents->Load('SubDirectorios/TestDemo');

                // Load path Controller/Component/SubDirectorioX/MiFunctionDemo1Component.php
                $this->MiFunctionDemo1 = $this->LoadSubComponents->load('SubDirectorioX/MiFunctionDemo1');
                $this->MiFunctionDemo3 = $this->LoadSubComponents->load('SubDirectorio/SubX/MiFunctionDemo3');

                // Demo1 de como utilizarla
                $this->MiFunctionDemo1->MiAccion1('Demo');
                $this->MiFunctionDemo1->MiAccion2('Demo');
        }

        public function index(){

            // TestDemo de como utilizarla
            echo $this->TestDemo->hello('Hi EOM !!!');

            // Load path Controller/Component/SubDirectorioX/MiFunctionDemo2Component.php
            $this->MiFunctionDemo2 = $this->LoadSubComponents->load('SubDirectorioX/MiFunctionDemo2');

            // Demo2 de como utilizarla
            $this->MiFunctionDemo2->MiAccion1('DemoIndexBla');

            // Reutilizar Demo1 load en el __construct
            $this->MiFunctionDemo1->MiAccion101('DemoIndexBlaBla..');

            // Utilizar Demo3 load en el __construct
            $this->MiFunctionDemo3->MiAccionDemoBla('DemoIndexBlaBla..');
        }

        // ...

    }
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

2047d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1219132?v=4)[Sergio N.](/maintainers/EOM)[@EOM](https://github.com/EOM)

---

Top Contributors

[![EOM](https://avatars.githubusercontent.com/u/1219132?v=4)](https://github.com/EOM "EOM (38 commits)")

### Embed Badge

![Health badge](/badges/eom-plugin-cakephp-loadsubcomponents/health.svg)

```
[![Health](https://phpackages.com/badges/eom-plugin-cakephp-loadsubcomponents/health.svg)](https://phpackages.com/packages/eom-plugin-cakephp-loadsubcomponents)
```

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

2988.9k3](/packages/dereuromark-cakephp-dto)[proloser/cakephp-csv

5223.6k](/packages/proloser-cakephp-csv)[loadsys/cakephp_sitemap

A CakePHP Plugin for adding automatic XML and HTML Sitemaps to an app

2819.6k](/packages/loadsys-cakephp-sitemap)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
