我更新cakephp。我想写一个不关于查看(功能)的功能。但是当我调用这个函数resultCall来定义函数。我的代码如下如何建立一个函数并在cakephp中无处不在
public function records(){
$totalrec = $this->names->find('count');
$pages = ceil($totalrec/$limit);
return $pages;
}
,并把它作为
$rowsr = records();
请帮助
可能的重复[在CakePHP中放置自定义函数](http://stackoverflow.com/questions/5530601/where-to-put-a-custom-function-in-cakephp) – jurgemaister
您需要重新思考你的逻辑在这里,也许你不需要。而'$ limit'在这里没有定义。 – skywalker