在 laravel 4 中加载视图时未定义 $load 属性

undefined $load property when loading view in laravel 4

我需要执行在我的控制器中加载视图的过程,这可以使用类似的方法完成:

$main['menu'] = $this->load->view('myView', NULL, TRUE);

但是在执行时我收到一条错误消息 未定义 属性:MainController::$load

如何解决这个问题,或者您是否可以给我另一种方法来完成这项工作

您可以在控制器中生成视图:

// get the view object
$view = View::make('myView'));

// get view content as string
$content = $view->render();

// pass the content to another view
$anotherView = View::make('anotherView', array('content' => $content));

您可以在 Laravel 4 中阅读有关如何使用视图的更多信息:http://laravel.com/docs/4.2/responses#views。我建议您在这里看看,因为您尝试做的事情似乎不是 Laravel.

中的标准做事方式