1
votes

The controller

class PagesController extends AppController 
{
    public $helpers = array('Formatacao');
    .
    .
    .
}

The helper

class FormatacaoHelper extends AppHelper 
{
var $name = 'Formatacao';
    .
    .
    .
}

I'm getting this error in layout: Undefined property: View::$Formatacao [APP\views\layouts\default.ctp, line 51]

Trying to use like this: $this->Formatacao->get_clean_base_url(false);

What i'm missing?

Best regards.

1

1 Answers

0
votes

You are not supposed to add the helpers to CakePHP's PagesController.

Do that in AppController instead:

class AppController extends Controller {
   public $helpers = array('Formatacao');
}