bernhard Posted July 8, 2016 Share Posted July 8, 2016 hi! i try to add a custom method to FilenameArray class to check if a file exists and remove it from array if not... public function init() { $this->addHook('FilenameArray::cleanup', $this, 'cleanupFileArray'); } /** * remove non existant files from file array */ public function cleanupFileArray($event) { // do some stuff } but i always get the error Fatal Error Call to undefined method ProcessWire\FilenameArray::cleanup() it works when i use Page::cleanup and Pages::cleanup and also when i add the method directly into the core file... but thats no option. what am i doing wrong? Link to comment Share on other sites More sharing options...
Soma Posted July 8, 2016 Share Posted July 8, 2016 FilenameArray is just a helper class not a Wire class like Page or Pages. 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