4

How to retrieve data from model with $useTable = false

i tried, actually, it doesnt work.

class Blablah extends AppModel {
   public $useTable = false;
   public $data = array(
           array( "id"=>0, "fied1" => "bla", "field2" =>"blah"), ...
   );
}

2 Answers 2

1

There is already a pretty good answer on this topic here on StackOverflow.

You should also checkout different datasources - it might be just what you're looking for. I would use array_source for what you need.

Sign up to request clarification or add additional context in comments.

Comments

0

In the controller action, you can load the required model and access its data as:

$this->loadModel('Blablah');
debug($this->Blablah->data);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.