2017 © Pedro Peláez
 

cakephp-plugin model_alias

ModelAlias

image

k1low/model_alias

ModelAlias

  • Monday, March 9, 2015
  • by k1LoW
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,853 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

ModelAlias

Use alias in Controller::uses, (*1)

<?php
App::uses('Controller', 'Controller');

/**
 * Application level Controller
 *
 */
class AppController extends Controller
{
    use ModelAliasTrait;

    public function __construct($request = null, $response = null)
    {
        // ModelAliasTrait
        $this->initUsesAlias();
        parent::__construct($request, $response);
    }

    public function loadModel($modelClass = null, $id = null)
    {
        // ModelAliasTrait
        return $this->loadAliasModel($modelClass, $id);
    }
}
<?php

class AdminUsersController extends AppController
{
    public $uses = [
        'User' => ['className' => 'AdminUser'],
    ];

    public function view($id = null)
    {
        $this->set(['user' => $this->User->view($id)]);
    }
}

The Versions

09/03 2015

dev-master

9999999-dev https://github.com/k1LoW/ModelAlias

ModelAlias

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp model

09/03 2015

0.0.4

0.0.4.0 https://github.com/k1LoW/ModelAlias

ModelAlias

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp model

09/03 2015

0.0.3

0.0.3.0 https://github.com/k1LoW/ModelAlias

ModelAlias

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp model

21/01 2015

0.0.2

0.0.2.0 https://github.com/k1LoW/ModelAlias

ModelAlias

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp model

21/01 2015

0.0.1

0.0.1.0 https://github.com/k1LoW/ModelAlias

ModelAlias

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp model