MarkE Posted May 19 Share Posted May 19 Just a brief 'sort of' tutorial based on my experiences documented here. I have built a couple of modules in the past which created and used their own specific templates and which had page classes associated with these. My approach has been to put the scripts containing the page classes in the same directory as the module (rather than the classes directory) so as to keep all the module-related stuff together. I would then'include/require' those scripts in my module init() method. This worked very well until recently. Then, as documented in the above link, I found that in some circumstances (the details of which still escape me but might be to do with the number of templates involved) the page classes were not always being applied in time for all templates. My solution is to put the include/require in the module's __construct() method as it is called before init(). This seems to work, but bear in mind that the full API is not available at this time. 1 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