Vigilante Posted September 15, 2017 Share Posted September 15, 2017 I'm taking over working on an existing PW site. I see the function e() used a lot in the templates but I can't find info on it. For example $this->e($page->get('something|other')) As you might imagine, trying to search for the letter "e" anywhere doesn't get me very far. I've looked high and low in the API docs and tried to search through source files for the function definition. I'm not even sure it's a PW function at this point. I assume in these templates that $this refers to the PW object, and I couldn't find e() in the docs. The way the code is written makes it seem like it's just a function to prepare output to the browser, perhaps it's an HTML entity encoder or something? Is this a PW function and where are the docs? Link to comment Share on other sites More sharing options...
adrian Posted September 15, 2017 Share Posted September 15, 2017 That's not a PW function, so it must be custom. You could search files for "function e(" or you could install Tracy Debugger and enable the "Template Resources" panel which shows you all custom functions (and variables) and where they are defined. 1 Link to comment Share on other sites More sharing options...
fbg13 Posted September 15, 2017 Share Posted September 15, 2017 Another way is to use a code editor that lets you go to a functions definition. For example vs code can do that with the PHP IntelliSense extension or the new Atom ide. Other editors/ide might have this feature too. http://langserver.org/ Link to comment Share on other sites More sharing options...
Vigilante Posted September 15, 2017 Author Share Posted September 15, 2017 Good. Looks like whoever built this injected an alternate template engine and so the e() function belongs to the template engine. That's why it references "$this" instead of using the normal $page object of PW. Thought I was going a little nutty for a minute! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now