Category Covered

cakephp call function within controller

For example you have the following function that you want to use inside another function

public function token(){
echo $this->Auth->user('id');
}

Here is another function where you are going to use the given token function

public function counter(){
$this->token();
}