3 ms·
I like the approach you took with elefant as an MVC framework. The "handler" thing is interesting...
by ericingram 15y ago
I like the approach you took with elefant as an MVC framework. The "handler" thing is interesting...
- lux 15y agoThanks! Making "handlers" feel like ordinary PHP scripts that execute top-down seems like the most natural way in PHP, since that's how the language itself works. It's not much different than inverting the require statement, your front controller includes your handler after initializing some helpers for you :) It's not as "structured" as methods in a class that extends a Controller class, but it works just as well and eliminates a good bit of boilerplate code in the process. Also helps new developers get up to speed quickly I've found.
- ericingram 15y agoI agree with you. My one bit of criticism might be, in a plain php file without any code block wrapping handler logic, it's harder to understand context. I don't know exactly where this file is getting executed, and so it's not clear where the contextual properties are coming from? Perhaps that's the point.
- lux 15y agoHopefully that's where good docs come in ;) But I definitely agree that can cause confusion if not explained carefully.
- ericingram 15y agoHave you thought about releasing the framework separately? I'd be interested in working with you.
- lux 15y agoIt's definitely a possibility! That would mostly just be a matter of removing the default apps and layouts, then cleaning up the configs that pertain to the CMS. Would make a fun weekend project :) Releasing the framework separately would take care not to add confusion to the documentation side of things. Then again, having a separate 'elefant-core' project that the CMS builds on may even help...