Jump to content

Problems with $sanitizer


evanmcd
 Share

Recommended Posts

Hi all,

Strange problem I'm running up against here - just trying to use $sanitizer->name() on a string I want to end up as an HTML class value.

In my PW template, if I call it in the main scope of the page, it's fine.

If I call it inside a function, I get a call to a non-object error.

OK, so just for kicks I passed $sanitizer into the function, but still get the same error.

Then, I figure OK I'll create a module that manages the markup I'm creating (seems like a good thing to do anyway). But, much to my dismay, I get the same error when calling from within the module.

How do I properly call it in any other scope other than the global scope of a template?

Or am I missing something much more simple?

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...