One solution would be ArraySource from plugin 
https://github.com/cakephp/datasources

- app/Config/bootstrap.php:
CakePlugin::load('Datasources');

- app/Config/database.php:
class DATABASE_CONFIG {
        public $array = array('datasource' => 'Datasources.ArraySource');
        ...
}

- app/Model/Testimonial.php
class Testimonial extends AppModel {
        public $useDbConfig = 'array';
        public $records = array(
                array(
                        'id' => 1,
                        'title' => 'Title #1',
                ),
        );
}

- create TestimonialsController, or in any controller:
$this->loadModel('Testimonial');
$this->set('testimonials', $this->Testimonial->find('all');

If you'll want to move testimonials data out of model source, overload
constructor of Testimonial model and use Configure::load/read() for
initialization of $this->records property.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to