Question

In a view, I've created a function that masks some repeating helper calls.
The problem is that it can't use the $this variable, since it's not in a context. the error is:

Fatal error: Using $this when not in object context
  1. How can I override it?
  2. What is the context in the view? is it the view class?

it's cake 1.3

Was it helpful?

Solution

Seems that it is impossible, it's a language restriction.

The solution was to call the class itself, by using HelperName::method_name() from within the function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top