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
Eliminating beginPage() and endPage() in layouts #1548
Conversation
This one should not be merged (there changes from other branches). Keeping it for discussion purpose. |
Ok. Just take a look how it is easy. |
It looks like it's eliminating a chance to register assets at the very top of layout like the following: <?php
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
/**
* @var \yii\web\View $this
* @var string $content
*/
AppAsset::register($this);
?>
<?php $this->beginPage() ?> |
@egorpromo Why do you still insist that beginPage/endPage belongs to layout? As I repeatedly many times, this is not the design. beginPage/endPage just marks the begin/end of a complete view-based response. You can use it in layouts or views if layout is not needed. |
@samdark Yes, this is a side effect of eliminating beginPage/endPage. I actually thought about eliminating beginPage/endPage as @egorpromo suggested. But I didn't come up with a clean solution. |
@samdark No. Why do you think now it is not possible? |
@qiangxue The endPage() is only for layouts file. There is no need to have endPage() if we don't have head(), beginBody() and endBody(). So, endPage() is for layouts only. |
Let me try to explain one last time. beginPage/endPage marks the begin/end of a complete view-based response. What you saw in |
Maybe renaming those to |
We had one View class recently. It is @samdark has made strange stuff in View.
It is abstract meaning. My thoughts simple is better. It is juggernaut you can't ignore. |
@lucianobaraglia I was unhappy because I have a look at Yii1. After many years of developement Yii has lose his initial good arhitecture. I was very upset. Now it sems yii-developers take into accout the last deficiencies and make more good framework. So I become a little happy |
@egorpromo I'm not saying |
@qiangxue What prevents to accept my PR? |
Please read my previous response. |
You say it is possible to eliminate |
I was saying I couldn't find a clean solution to this. Also having |
@qiangxue Ok. I have seen so many times these methods... Of course now I will not forget it. |
Sorry. My knowlege about Git are very bad. I make some proposal to eliminate beginPage() and endPage() for #1507