Scaffolding on steroids! :) Copyright 2010-2012, Nodes ApS. (http://www.nodesagency.com/) Licensed under The MIT License Redistributions of files must retain the above copyright notice.
또한 보기: http://book.cakephp.org/2.0/en/controllers/components.html#Component
상속: extends Component
 /**
  * Class constructor
  *
  * @param string $prefix CRUD component events name prefix
  * @param array $models List of models to be fetched in beforeRenderEvent
  * @return void
  */
 public function __construct(CrudSubject $subject)
 {
     $this->_subject = $subject;
     $this->_config = $this->_defaults;
     if (!isset($subject->crud)) {
         return;
     }
     $this->_crud = $subject->crud;
     if ($translations = $this->_crud->config('translations')) {
         $this->config($translations);
     }
 }
 /**
  * List of events implemented by this class
  *
  * @return array
  */
 public function implementedEvents()
 {
     return array($this->_crud->config('eventPrefix') . '.beforeRender' => 'beforeRender');
 }
 /**
  * test visibility wrapper - call protected method _setModelProperties
  */
 public function setModelProperties()
 {
     return parent::_setModelProperties();
 }
 /**
  * Test that providing configuration for a new
  * listener in the Crud setting should preserve
  * the defaults and add the new listener to the array
  *
  * @return void
  */
 public function testConstructMerging2()
 {
     $Collection = $this->getMock('ComponentCollection');
     $config = array('listeners' => array());
     $Crud = new CrudComponent($Collection, $config);
     $result = $Crud->config();
     $expected = array('actions' => array(), 'eventPrefix' => 'Crud', 'listeners' => array('RelatedModels' => 'Crud.RelatedModels'), 'messages' => array('domain' => 'crud', 'invalidId' => array('code' => 400, 'class' => 'BadRequestException', 'text' => 'Invalid id'), 'recordNotFound' => array('code' => 404, 'class' => 'NotFoundException', 'text' => 'Not found'), 'badRequestMethod' => array('code' => 405, 'class' => 'MethodNotAllowedException', 'text' => 'Method not allowed. This action permits only {methods}')), 'eventLogging' => false);
     $this->assertEquals($expected, $result);
 }