Php 更改Lightspeed Webstore中的布局

Php 更改Lightspeed Webstore中的布局,php,yii,e-commerce,Php,Yii,E Commerce,我的Lightspeed Webstore(一个基于Yii 1.1的电子商务框架)中有一个自定义控制器 默认情况下,column2始终是页面的选定布局,我无法对此进行更改 以下是我的示例控制器: <?php class ExampleController extends Controller { public $layout = "column2"; public function actionIndex() { $this->layout =

我的Lightspeed Webstore(一个基于Yii 1.1的电子商务框架)中有一个自定义控制器

默认情况下,column2始终是页面的选定布局,我无法对此进行更改

以下是我的示例控制器:

<?php

class ExampleController extends Controller {

    public $layout = "column2";

    public function actionIndex() {
        $this->layout = "column1";
        $this->render('index');
    }

通常
第2列
文件位于
布局
文件夹下。我假设你在一个模块里工作。因此,您可以将该属性重写为

public $layout='/layouts/column2';
如果要使用column1,则

public $layout='/layouts/column1';
如果使用“上线”,则整个控制器的布局将保持不变。如果要对每个操作应用自定义布局,可以使用

public function actionYourAction()
{
$this->layout='/layouts/column2';
$this->render('your view');
}

也可以在需要自定义布局的指定视图中执行此操作。您可以在页面顶部提到它。相同的代码将在视图中工作。

转到您的组件/controller.php,将定义默认的布局设置。。。你可以在那里换车。。。。!!!存在子目录,但它是空的…您是否正确设置了config/main.php以指向brooklyn2014copy主题?它在主题中找到了视图的正确位置。。。这意味着设置正确是吗?非常接近-在文件顶部的视图文件中,此操作成功:$this->layout=“/layouts/column1”;如果你编辑你的答案以提及视图/小格式差异,我也会接受你的答案(我已经给了赏金)。