标签: yii

Yii只呈现一页没有布局

我有一个奇怪的问题.我将我的网站复制到生产环境(从windows到ubuntu).我纠正了一些大/小写字母问题,应用程序开始正常工作.直到我进入一个看起来像没有布局呈现的页面.没有错误.另外 - firebug没有显示css样式或任何东西.在HTML源代码中也缺少布局代码.可能是什么原因?

编辑:

控制器部分:

$dataProvider = Projects::model()->getInviteProjectsProvider();
$this->render('invite', array(
    'dataProvider' => $dataProvider
));
Run Code Online (Sandbox Code Playgroud)

它返回CActiveDataProvider.

视图:

<?php

$this->breadcrumbs=array(
    'Projekty' => array('admin'),
    'Zapraszanie',
);

$this->renderPartial('_allMenu');

?>

<link rel="stylesheet" type="text/css" href="<?php echo $this->module->assetsUrl; ?>/css/projects.css"/> 

<h1>Projekty aktywne - zapraszanie</h1>
<?php   

    $this->widget('bootstrap.widgets.TbExtendedGridView', array(
        'id' => 'invite-grid',
        'type' => 'striped condensed',
        'dataProvider' => $dataProvider,
        'rowCssClassExpression' => '($data->leftCustomers<100) ? "error":""',
        'columns' => array(
            array(
                'name' => 'idProject',
                'htmlOptions' => array('width' => '60px', 'style' => 'text-align: right;', 'class' => 'gridIdColumn'),
            ),
            'name',
            array(
                'name' => 'leftCustomers',
                'header' …
Run Code Online (Sandbox Code Playgroud)

php layout themes render yii

1
推荐指数
1
解决办法
1万
查看次数

yii框架报告工具

我正在评估使用YII框架的应用程序.这个应用程序有2个要求非常重要.首先是报告.我必须制作大量的报告和子报告.第二,报告必须导出为word,pdf和xls.

我知道PHP对报告工具不是很友好.我认为最好的可能是贾斯珀报告?但是这个工具可以帮助我获得2分?

您是否在php中使用报告工具和预先报告?你能给我一个建议吗?

谢谢.

reporting jasper-reports yii

1
推荐指数
1
解决办法
3199
查看次数

复合CHtml :: listData值

我想在下拉列表中发布组值.我如何在值字段中连接id和分组(type)?

CHtml::listData($eventLocationByUser, 'id', 'caption', 'type');

我试过了:

CHtml::listData($eventLocationByUser, 'id'.'type', 'caption', 'type');

但是返回空值.

javascript php yii

1
推荐指数
1
解决办法
2992
查看次数

功能测试clickAndWait不起作用

我在yii中编写web应用程序,phpunit selenum测试是我登录表单的测试用例

public function testHasLoginForm()
    {
        $this->open('site/login');
        $this->assertTextPresent('Login');

        $this->assertElementPresent('name=LoginForm[username]');
        $this->assertElementPresent('name=LoginForm[password]');

        $this->assertTextPresent('Remember me next time');  
        $this->assertTextPresent('Reset Password?');

        $this->assertElementPresent('name=Login');

        $this->type('name=LoginForm[username]','pradeep@techanveshan.com');
        $this->type('name=LoginForm[password]','password');

        $this->clickAndWait("//input[@value='Login']"); //this line cause the error

    }
Run Code Online (Sandbox Code Playgroud)

一切正常,除非我把这个命令 $ this-> clickAndWait("// input [@ value ='Login']");

这行给了我这样的错误:

Invalid response while accessing the Selenium Server at "http://localhost:4444/s
elenium-server/driver/:" ERROR: Command execution failure. Please search the use
r group at https://groups.google.com/forum/#!forum/selenium-users for error deta
ils from the log window.  The error message is: Value does not implement interfa
ce Event.
Run Code Online (Sandbox Code Playgroud)

有谁知道为什么会这样?

php selenium phpunit yii selenium-webdriver

1
推荐指数
1
解决办法
1311
查看次数

活动交易和PHP

给定一个PHP类具有几种函数的样式

public function $op_Data() {
    $command = Yii::app()->db->createCommand("");
    $transaction = Yii::app->db->beginTransaction();

    try {
      //code here
      $transaction->commit()
    } catch (Exception $e) {
      $transaction->rollback();
      return "Operation Failed\n" . $e->getTraceAsString();
    }
}
Run Code Online (Sandbox Code Playgroud)

在提交操作成功或返回错误后,是否可以继续使用先前方法中的事务?

我的意思是,调用插入函数.它检查事务是否处于活动状态并使用它.如果事务处于非活动状态,则会创建一个事务.对需要事务功能的所有函数进行相同的检查.

如果存在此功能,它是否会影响特定功能中的提交/回滚操作?

php transactions yii

1
推荐指数
1
解决办法
6829
查看次数

Yii中jquery-ui.css的路径

我正在使用Yii框架,每当我打开页面时,它会在资产中加载jquery-ui.css.我想改变那个css并应用我的css.我怎么能改变那个css.或者从这个文件来的地方.在框架中jquery-ui.css的路径是什么.

yii

1
推荐指数
1
解决办法
1198
查看次数

yii - 10秒后如何重定向

我是yii框架的新手,我看不到有关如何在页面上传递10秒后重定向的任何信息或论坛.例如,在重置密码后,我想重定向到登录页面,但只有10秒才允许用户在页面上看到消息显示.

javascript php redirect yii

1
推荐指数
1
解决办法
3946
查看次数

如何在没有PATH格式的YII中获取查询字符串值?

我有以下网址,

www.example.com/index.php?r=recommend/create&id=184?
title=Ruins%20of%20Mahabalipuram
&url=http://localhost/index.php/mediadetail/index/184
Run Code Online (Sandbox Code Playgroud)

我需要获取标题和url,它们是查询字符串参数.

有没有人在Yii中获取查询字符串中的值?

php yii

1
推荐指数
1
解决办法
5744
查看次数

Yii zii.widgets.CDetailView - 将属性输出为HTML代码格式

我希望输出属性description为CDetailView中的HTML代码.

<?php $this->widget('zii.widgets.CDetailView', array(
    'data'=>$model,
    'attributes'=>array(
        'id',
        'title',
        'description' => array(
            'name' => 'description',
            'value' => html_entity_decode(CHtml::decode($model->description)),
        ),
        'price',
        'date',
    ),
));?>
Run Code Online (Sandbox Code Playgroud)

html php format widget yii

1
推荐指数
1
解决办法
5136
查看次数

Yii - 模型文件中的大多数函数都应该是静态函数吗?

我是Yii框架用户.

我主要在我的模型文件中将函数定义为公共静态函数,如下面的示例函数.

public static function getTrashedPostCount(){           
    $connection=Yii::app()->db;     
    $sql = "SELECT COUNT(publish_status)
                FROM {{post}}
                WHERE publish_status = 'trash'";              
    $command=$connection->createCommand($sql);
    $postCount = $command->queryScalar();
    return $postCount;      
}   
Run Code Online (Sandbox Code Playgroud)

我想知道我做错了.

模型文件中的大多数函数应该是静态函数吗?

如果我正在做或理解错误,请告诉我.

谢谢!!!

php yii yii-cmodel

1
推荐指数
1
解决办法
1283
查看次数