Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how should basset be used with packages in laravel 4 #203

Open
newtonianb opened this issue Sep 13, 2013 · 0 comments
Open

how should basset be used with packages in laravel 4 #203

newtonianb opened this issue Sep 13, 2013 · 0 comments

Comments

@newtonianb
Copy link

Currently the way I use basset is I define all my collections as routes in string inside my basset/config.php file in the form 'controller.method' then I have one dynamic basset loader that loads the collections based on the route.

so for example AccountsController@edit will load basset account.edit

app/config/packages/jasonlewis/basset/config.php

'account.edit' => function($collection) {
  $directory = $collection->directory('assets', function($collection) {
    $collection->stylesheet('css/account/edit.css');
    $collection->javascript('css/account/edit.js');
  });
},

This works fine now my question how do I handle by bundle css and js.

I don't want to create a collection inside app/config/packages/jasonlewis/basset/config.php because this looses the modularity of my package.

Currently the only thing I need to use this package is call in any view != charts::startLoad($data) which calls the startLoadfunction inside workbench/newton/charts/src/Newton/Charts/Charts.php and returns a view.

I'm looking for a way for the bassets to automatically get loaded from the startLoadfunction or somwhere where it could be programatic. How would I do this?

workbench/newton/charts
│   composer.json
│   composer.lock
│   phpunit.xml
│
├───public
│       script.js
│       style.css
│
├───src
│   ├───controllers
│   │       ChartsController.php
│   │
│   ├───Newton
│   │   └───Charts
│   │       │   Charts.php
│   │       │   ChartsServiceProvider.php
│   │       │
│   │       └───Facades
│   │               Charts.php
│   │
│   ├───migrations
│   │       2012_11_06_225921_create_charts_table.php
│   │
│   ├───models
│   │       Chart.php
│   │
│   └───views
│           _table_view.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant