PHP Cycle Projects
-
Project mention: Cash: A small jQuery alternative for modern browsers | news.ycombinator.com | 2024-11-02
Thanks. It's a small custom framework built from libraries, some custom, some third party.
- File based HTTP router running on top of https://frankenphp.dev/
- ORM/SQL with: https://github.com/cycle/orm but this is preference. Anything works. From SQL builders to ORMs.
I'll try to explain their form handling:
Forms almost always POST to their own GET URL.
If you GET /user/save you'll get back HTML and `` to build the form.<p>If you POST /user/save you're expected to pass the entire form data PLUS an "operation" parameter which is used by the backend to decide what should be done and returned.<p>For example if user clicks [add new user] button, the "operation" parameter has value of "btnNewUser.click".<p>Why pass operation parameter? Because business forms can have more than just a [submit] button.<p>For example, there might be a datagrid filter value being changed (operation: "txtFilter.change"), or perhaps a dropdown search to select a city name from a large list (operation: "textCitySearch.change"), it can be a postal code to address lookup (operation: "txtPostalCode.change"), etc.<p>On the backend, the pseudocode looks somewhat like this but it's cleaner/safer because of encapsulation, validation, error handling, data sanitization, model binding and csrf/xss protection:<p><pre><code> function user_save($operation) {
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
laravel-cycle-orm-adapter
🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.
I use this approach in my wayofdev/laravel-cycle-orm-adapter package. The configuration file can be viewed here: config/cycle.php
PHP Cycle discussion
PHP Cycle related posts
Index
# | Project | Stars |
---|---|---|
1 | Cycle ORM | 1,243 |
2 | laravel-cycle-orm-adapter | 25 |