标签: yii

在 php 中使用 posix_kill 的问题

我正在使用php 5.5.11,当我尝试调用时posix_kill,出现以下错误:
Fatal error: Call to undefined function posix_kill() in /var/www/.../someScript.php on line 861

我不确定还有哪些相关信息,请随时提问。

php linux yii

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

CDbConnection 无法打开数据库连接:SQLSTATE[IMSSP]: The given attribute is only supported on the PDOStatement object

我是 Yii 框架编程的初学者。想要使用 Gii 扩展,我无法使用。某些功能,例如 Crud 生成器,会生成异常。

CDbConnection failed to open the DB connection: SQLSTATE[IMSSP]: The given attribute is only supported on the PDOStatement object. 
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

在我的main.php配置文件中,我有以下与连接字符串、导入和模块变量相关的代码部分:

'import'=>array(
    'application.models.*',
    'application.components.*',
            'ext.giix-components.*',
        //additionally added for Giix
),

'modules'=>array(
    // uncomment the following to enable the Gii tool

    'gii'=>array(
        'class'=>'system.gii.GiiModule',
        'password'=>'pass',
                    'generatorPaths' => array('ext.giit-core'),
        // If removed, Gii defaults to localhost only. Edit carefully to taste.
        'ipFilters'=>array('127.0.0.1','192.168.0.83'),

    ),

),

// application components
'components'=>array(
    'user'=>array(
        // enable cookie-based authentication
        'allowAutoLogin'=>true,
    ),

    'db'=>array( …
Run Code Online (Sandbox Code Playgroud)

php yii sql-server-2008

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

循环遍历Yii2中的大量数据库行

我正在使用Yii2,我的数据库服务器是MySQL.我需要扫描整个db表的每一行,搜索某些文本的出现.

这就是我想要的,但由于记录数量很多,我不确定我是否这样做,服务器不会耗尽内存或MySQL服务器不会消失:

$rows = Posts::find()->select('content')->all();
foreach($rows as $post) {
    // do some regex on $post['content']. no need to save it back to the table.
}
Run Code Online (Sandbox Code Playgroud)

它是一个带有大型数据库的实时服务器.我必须动手做,不能取下服务器进行备份和恢复!

这会有用吗?有没有更好的方法来做到这一点?

yii yii2

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

漂亮的网址在yii2不工作

在web.php我有这个

'urlManager' => [
        'enablePrettyUrl' => true,
        'showScriptName' => false,
        'rules' => [
            '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
            '<controller:\w+>/<id:\d+>' => '<controller>/view',
        ],
    ],
Run Code Online (Sandbox Code Playgroud)

这个文件夹的apache配置像这个php.conf文件

<VirtualHost *:80>
AssignUserId alexzander alexzander
ServerName localhost

DocumentRoot /home/alexzander/Dropbox/study/3year/2/php/
<Directory /home/alexzander/Dropbox/study/3year/2/php/>
    # use mod_rewrite for pretty URL support
    RewriteEngine on

    # If a directory or a file exists, use the request directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # Otherwise forward the request to index.php
    RewriteRule . index.php

    Order allow,deny
    Allow from all
    Require all …
Run Code Online (Sandbox Code Playgroud)

php url-rewriting yii yii2

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

Google饼图在yii中不起作用

在我的Yii网络应用程序中,Google图表无法正常工作。我正在通过renderpartial方法获取所有值。但是,不显示饼图。

我的代码是

<div class="content">
<div id="graph" style="width:300px;height:300px ">
</div>
</div>
<script type="text/javascript" src="https://www.google.com/jsapi">
    // Load the Visualization API and the piechart package.
 google.load("visualization", "1", { packages: ["corechart"] });
    // Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(createPIE);
    // Callback that creates and populates a data table,
    // instantiates the pie chart, passes in the data and
    // draws it.
function createPIE() {

    var options = {
        title: 'Fees Allocation',
        colors: ['#888', 'orange','red'],
        is3D: true
    }; …
Run Code Online (Sandbox Code Playgroud)

charts yii

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

Yii2:得到总和在gridview的页脚

我是新来的,我不能在这里发表评论

当我试图在页脚中获得总和时,我遇到了问题.

我在控制器中的代码:

$searchModel = new ReceiptsSearch();
$sum = new ReceiptsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
 return $this->render('index', [
   'searchModel' => $searchModel,
   'dataProvider' => $dataProvider,
   'sum'=>$sum,
   ]);
Run Code Online (Sandbox Code Playgroud)

我的SearchModel代码:

public function search($params)
{
    $query = Receipts::find();
    $sum = $query->sum('price');
    $dataProvider = new ActiveDataProvider([
        'query' => $query,
    ]);

    $this->load($params);

    if (!$this->validate()) {
        return $dataProvider;
    }
    $query->joinWith('patient'); 
    $query->andFilterWhere([
       'id' => $this->id,
       'price' => $this->price,
       'reg_date' => $this->reg_date,
    ]);
    $query->andFilterWhere(['like','patient.patient_name',$this->patient_id]);

    return $dataProvider;$sum;
}
Run Code Online (Sandbox Code Playgroud)

我的观点页面

<?= GridView::widget([

    'dataProvider' => $dataProvider,$sum,

    'filterModel' => $searchModel,
    'showFooter' => …
Run Code Online (Sandbox Code Playgroud)

gridview sum yii yii2 yii2-advanced-app

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

Yii 2.0类命名

我想用enablePrettyUrl = true将我的控制器映射到urlManager.

当类的名称是Ts4Controller,它映射得非常好

'https://' . $configDomain['siteMainDomainName'] . '/ts4'=> 'ts4/index',
Run Code Online (Sandbox Code Playgroud)

但当我将控制器名称更改为TheSims4Controller

'https://' . $configDomain['siteMainDomainName'] . '/ts4'=> 'thesims4/index',
Run Code Online (Sandbox Code Playgroud)

它不起作用,它将得到404错误.

Yii 2.0中是否有对控制器名称的一些要求?

非常感谢你!

yii yii2

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

Giar Extension for Laravel

我需要类似Gii Extension for Laravel的工具,但找不到。

此扩展为Yii 2应用程序提供了一个基于Web的代码生成器,称为Gii。您可以使用Gii快速生成模型,表单,模块,CRUD等。

这是一些图片:

Gii图片

Gii图片

php crud yii gii laravel-5

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

SQL获取最近的日期记录

这是一个示例数据:

 Booking_id   Name   start_date
   1            abc   1/1/2018
   2            efg   5/2/2018
   3            pqr   16/1/2018
   4            xyz   19/2/2018
Run Code Online (Sandbox Code Playgroud)

我希望这是最接近今天的日期和最后的过去日期

php sql yii

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

Yii 1和Yii 2

我是Yii 2的新手,通常我使用Yii 1开发Web应用程序,现在Yii有新版本的Yii(Yii 2),我真的需要去Yii 2吗?Yii 1有安全隐患吗?

因为我看到Yii 2完全从Yii 1改变了.

php yii yii2 yii1.x

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