Skip to content

Conversation

@klimov-paul
Copy link
Member

This issue has been exposed at #1049

'ViewContext' Interface extracted, allowing to determine view file names via context as well as keeping common code inside the 'View'

@qiangxue
Copy link
Member

Looks good to me overall.

ViewContext should be renamed to ViewContextInterface, according to our previous discussion about interface naming convention.

Could you please check this PR #941 and see if your PR will fix the issue?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) when pulling 83e353d on klimov-paul:view-context-interface into 28aa451 on yiisoft:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) when pulling e0294ea on klimov-paul:view-context-interface into 28aa451 on yiisoft:master.

@klimov-paul
Copy link
Member Author

I am afraid there is no way ViewContextInterface can solve #941.

Usage of “Application::layoutPath”, “Module::layoutPath” eliminates such possibility.
When program flow comes to ‘Controller::findViewFile()’ there is no way to determine if the requested view should be searched at ‘viewPath’ or at ‘layoutPath’. This means I can not simplify or remove ‘Controller::findLayoutFile()’ method.

Note: the problem can be solved, if we eliminate separated ‘layoutPath’ and switched back to Yii1 practice of storing layouts under ‘viewPath’.

qiangxue added a commit that referenced this pull request Oct 29, 2013
Proposal: creating ViewContext interface to determine view name
@qiangxue qiangxue merged commit 0258c15 into yiisoft:master Oct 29, 2013
@qiangxue
Copy link
Member

Thanks!

@klimov-paul klimov-paul deleted the view-context-interface branch January 15, 2014 10:59
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

Successfully merging this pull request may close these issues.

3 participants