2017年3月27日月曜日

cakephp2 Call to undefined functionエラー

コントローラーに定義したfunctionを呼び出す際、表記エラーになった。
function定義
function isAuthorizedUserProj($proj_id) {
              ......
        }

ほかのfunctionから呼ぶ出す
        if (isAuthorizedUserProj($id)) {
              ......
        }

調べたところ、
In general you need to use $this-> when accessing class methods and variables.
ということで、if ($this->isAuthorizedUserProj($id))に変更すればOK

0 件のコメント:

コメントを投稿