tattersoftware / codeigniter4-assets

Asset handling for CodeIgniter 4
MIT License
50 stars 12 forks source link

Discussion: Route integration #16

Closed MGatner closed 3 years ago

MGatner commented 4 years ago

Would it be easier to apply Assets directly to the routes via app/Config/Routes, similar to how Filters are handled (as Route input)? Or move entirely to Filters with asset groups as input?

$routes->add('reports/chart', ['filter' => 'assets:chartjs,jquery,bootstrap']);
sfadschm commented 3 years ago

In the current state I think it would 👍 Else we have to write each defined route in the Config/Routes.php and again in Config/Assets.php, if I'm not overlooking something?

evansharp commented 3 years ago

I think this is way cleaner too.

MGatner commented 3 years ago

Thanks for the feedback all! I have some big changes coming to this library. There will definitely be a Filter and a way of creating asset collections... I haven't ironed out the details about how those interact but it will be a big improvement over the current handlers.