ssnukala / sprinkle-crud5
CRUD Module for UserFrosting 5.0.
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:userfrosting-sprinkle
Requires
- php: ^8.0
- birke/rememberme: ^2.0
- nikic/php-parser: ^4.2.2
- userfrosting/framework: ^5.0
- userfrosting/sprinkle-core: ^5.0
Requires (Dev)
- fakerphp/faker: ^1.17
- friendsofphp/php-cs-fixer: ^3.0
- mockery/mockery: ^1.2
- phpstan/phpstan: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-mockery: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-strict-rules: ^1.0
- phpunit/phpunit: ^9.5
- slam/phpstan-extensions: ^6.0
README
CRUD Sprinkle for Userfrosting 5.0
CRUD Functionality for all database tables
Feature List
- List view : Common base class that uses schema/crud5..yaml file to create a list page for the table contents accessible at
/crud5/. This utilizes pre defined Handelbars templates in a flat table view.
- TO-DO:
- one option specify handelbars template in the YAML so the user can set this dynamically (Can we load handlebar templates from a file ?) https://handlebarsjs.com/api-reference/compilation.html#handlebars-compile-template-options
- create twig template files for the column format with handlebars template in it, load that dynamically in the
- TO-DO:
- /api/crud5/ for all the CRUD Operations
- /modals/crud5// : the CRUD5Injector is giving an error TODO: Need to learn how injector works here, goal is to dynamically set the the model based on the crud_slug parameter from the Route
require 'vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
$data = [
'name' => 'Jane Smith',
'email' => 'jane@example.com',
'age' => 25,
];
$yaml = Yaml::dump($data);
file_put_contents('data.yaml', $yaml);
echo "Array converted to YAML and saved as 'data.yaml'.";
$data = [
'name' => 'Michael Johnson',
'email' => 'michael@example.com',
'age' => 35,
];
$yaml = yaml_emit($data);
file_put_contents('data.yaml', $yaml);
echo "Array converted to YAML and saved as 'data.yaml'.";