Single page module for Yii2

What is the best way to create a single page module for Yii2?

For example using Ember, I will have index.html and assets folder to publish.

I see two ways, one would be to just put the application under web accessible folder, it will work fine.

But what if i want to check access to the application using existing RBAC?

Another way would be to create a module and in default controller have something like


return $this->renderFile('@path/to/index.html');

And load all assets with Asset Bundle.

The problem with this approach is that i will not know the folder where assets will be loaded (it can be solved with afterCopy callback or something, but all this doesn’t look nice at all).

Please advise.

You can have assets in public dir registered with a bundle.

Thank you, i end up with this solution.

Unfortunately i could not make ember-cli to upload assets to the upper folders, so i had to use gulp for that.

But i think i’ve got exactly what i wanted.