3 ms·
I'm someone who uses a custom framework at work, and it's not verbose at all. Maybe I'm doing it wrong? I just spl_autoload_register on a controllers director
by halfjoking 9y ago
I'm someone who uses a custom framework at work, and it's not verbose at all. Maybe I'm doing it wrong?
I just spl_autoload_register on a controllers directory.
Then based on the url, it creates a class for the first part of the url and passes in the rest... $class = new $class_name();
$class->index($url_parts);
That class always extends an output class which uses a template system to render a component. I also use an ORM with a models folder that has a bunch of static functions to get data in each model class.
I would love to hear from someone more knowledgable about the disadvantages of my approach or why this articles is a better way of doing it. Of course I use composer and use a bunch of libraries for aws, oauth, Google APIs... but for the actual framework I keep it simple and haven't had problems so far.
- dvt 9y ago> I'm someone who uses a custom framework at work, and it's not verbose at all. Maybe I'm doing it wrong? Probably, not, it was just my sentiment by looking over the code in the article :) I haven't used PHP for almost 10 years, so I have no inkling of what "modern" PHP looks like.
- fein 9y agoSymfony 4 looks and feels like a slightly odd java Spring setup. Annotations are ugly as hell in PHP but thats a result of not having annotations supported in the language itself (you need an annotations preprocessor and they're all in comment blocks). There is an rfc for annotations in php as a language feature, so maybe someday. When that happens, Symfony may as well be Spring for PHP.