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

Remove block::$assets replace with Asset::register(Yii::$app->getView()); #1069

Closed
nadar opened this issue Nov 1, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@nadar
Copy link
Contributor

nadar commented Nov 1, 2016

Asse block asset produce large overhead and ram, the Yii way of asset integration should remove $assets and provide an example of how to integrat with Yii::$app->getView();

@nadar nadar added this to the 1.0.0 milestone Nov 1, 2016
@nadar nadar self-assigned this Nov 1, 2016
@nadar nadar closed this as completed in 8570f2d Nov 1, 2016
@nadar
Copy link
Contributor Author

nadar commented Nov 1, 2016

Upgrade Info from Guide:

Sometimes your block should also register some css or js files, therfore you can access the global {{\luya\web\View}} Object inside of your PHP view template. Its like registering other assets, by the difference that you are accessing the global scope view instead of the view on $this. An example of how to integrate an asset file:

Assuming the blow code is the PHP View of your Block:

MyBlockAsset::register($this->appView);

Now your [[app-assets.md]] is registered in the appliation view object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant