1
我無法弄清楚如何將幾個視圖合併到一個沒有刀片的部分。Laravel模板嵌套視圖
電腦板:
public $layout = 'layouts.template';
action_index{
$this->layout->nest('content', 'view1');
$this->layout->nest('content', 'view2');
}
的template.php:
<?php echo Section::yield('content'); ?>
view1.php:
<?php Section::start('content');?>
div1....
<?php Section::stop(); ?>
view2.php:
<?php Section::start('content');?>
div2....
<?php Section::stop(); ?>
現在 - 它只顯示視圖2
如何才達到類似的東西:
$content = View::make('view1');
$content = View::append('view2'); // append view2 to view1?
$this->layout->with('content', $content);
我知道你沒有使用刀片,但考慮使用它。這裏的嵌套很容易。 –