开发者

CakePHP calling field() within the model

开发者 https://www.devze.com 2023-03-28 21:51 出处:网络
I am writing a function within the php of the model. Is there any issue with using $this->field(\'something)

I am writing a function within the php of the model. Is there any issue with using

$this->field('something)

while inside the model? I can use other things lik开发者_JS百科e $this->saveField(...) fine but for some reason this is not returning me the value in the table correctly. Just wanted to make sure, thanks!


You have to specify the conditions first, like so:

$this->field('field_name', $conditions);

Or, I think you can also try setting the id first

$this->id = $id;
$this->field('field_name');
0

精彩评论

暂无评论...
验证码 换一张
取 消