Skip to content

Comment on The Micro PHP Manifesto's Missing Tenetparent

Comments

I like the approach you took with elefant as an MVC framework. The "handler" thing is interesting...

Thanks! 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.

I 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.

Hopefully that's where good docs come in ;) But I definitely agree that can cause confusion if not explained carefully.

Have you thought about releasing the framework separately? I'd be interested in working with you.

It'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...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.