yiisoft / view

Yii view rendering library
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
56 stars 44 forks source link

Move some view properties to view state #196

Closed vjik closed 2 years ago

vjik commented 2 years ago

ViewInterface immutable methods that modified properties:

withTheme()
withRenderers()
withLanguage()
withSourceLanguage()
withDefaultExtension()
withPlaceholderSalt()

We have to divide the properties modified by these methods into configurable once (usually in DI container config) and multiple times (DI container config + middleware for example).

Properties that are configured once must be changed immutable methods as they are now.

Properties that are configuraed multiple times should be saved in view state.

Suggest move to state theme and language (should we move to state source language?).