Just to clarify for anyone reading this, adding $useTable = false to
the model is not the solution. Mohammad mentioned that he was testing
"the situation in which DB is shut down" and how Cake would handle it.
I've just confirmed with 2.1.3 that the error page comes up ("Internal
error has occurre
lowpass, thats it. the problem is that FormHelper fetches the model data
inside the view. I don't know why this is the case, but as said, I managed
to solve the problem but I don't think it should be like that. it will be
interesting for the Cake developers to know however.
regards,
Mohammad
On
I think I see the problem. It's not that Mohammad is explicitly
querying the DB from the View, but that FormHelper is doing so behind
the scenes. It fetches the model's schema. In this case the DB is
unavailable and it's not being handled well.
It's odd that the error message (inside the H4$ tags)
Why there is some DB interaction during the View rendering? You dont
need to do any query "explicitly" on the View file, if you are calling
a method that does some DB interaction you are doing a Query during
the View Context.
If you need some data that comes from model (doesn't matter if it is
from
Hi,
I do no query from inside the View, I just call this:
$this->Form->create();
inside my view. the problem is that every thing inside view before this
line comes as a part of the exception handling output.
what I think is that because I don't call any db or model related actions
inside the contro
Are you making DB queries from within the View? You should be doing so
from the model or controller. Then, once the controller has all the
data it requires, it passes it to View to be rendered.
On Fri, Sep 14, 2012 at 4:43 AM, Mohammad Naghavi wrote:
> Hi,
> I'm dealing with an action of a contro
Hi,
I'm dealing with an action of a controller, in which no db interaction is
required until it comes to rendering the view. inside the view, again first
half of the view doesn't need any db interactions until a form creation is
started somewhere in the middle. I'm preparing my app for production
e