Right way to publish assets

What is architectural best way to publish assets: do it in controller actions and pass path to asset to views or do it in views?

When we use assets with widgets, we publish them in the run() method. So I suggest you to do the same with controllers - perform publishing inside actions.


And how about clientScript->register[Script|Css]File? Better to do this in view?

Yes, view/layout is a better place for this stuff. But sometimes it’s convenient to do that inside actions.