A
A
Alexander Pantyukhov2016-09-20 12:40:21
Yii
Alexander Pantyukhov, 2016-09-20 12:40:21

How to make full display of text in a table?

Good day. There is a table in which logins and passwords are displayed. With logins, everything is fine, but with passwords, not so much. There was a problem when one of the passwords became similar to something like this "MB *)@/<3EXD4F" only without the number 3, otherwise everything works wrong here too. The table is Kartik and is created like this:

echo grid\GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => $gridColumns,
    'containerOptions' => ['style' => 'overflow: auto;'], // only set when $responsive = false
    'headerRowOptions' => ['class' => 'kartik-sheet-style'],
    'filterRowOptions' => ['class' => 'kartik-sheet-style'],
    'pjax' => true, // pjax is set to always true for this demo
    'persistResize' => false,
    'export' => [
        'fontAwesome' => true
    ],
]);

column is written like this
[
        'class' => 'kartik\grid\EditableColumn',
        'label' => 'Password',
        'attribute' => 'passwordLog',//statusLiveId
        'value'=>function($model,$key,$index,$column){
            return '<div style="max-width: 400px;word-wrap: break-word;">'.$model[$column->attribute].'</div>';
        },
        'readonly' => function ($model, $key, $index, $widget) {
            if (isset($model['password'])) {
                return (!$model['password']); // do not allow editing of inactive records
            } else {
                return false;
            }
        },
        'editableOptions' => [
            'name' => 'password',//statusLiveId
            'header' => 'Password',
            'inputType' => \kartik\editable\Editable::INPUT_TEXT,
            'size' => 'md',
        ],
        'hAlign' => 'left',
        'vAlign' => 'middle',
        'width' => '400px',
        'format'=>'raw',
        'pageSummary' => true
    ],

such a password is displayed as "MB*)@", and it recognized the rest as a tag and as a result received such a string in HTML MB*)@<3exd4f< div=""><3exd4f<> (in the first case, remove 3 in the second instead of 3 there /).
Who faced a similar problem? Who will tell you the solution, or at least where to drip?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-09-20
@Paromon

1. Why show passwords? What is this innovation?
2. www.php.net/manual/ru/function.quotemeta.php
3. www.yiiframework.com/doc-2.0/yii-helpers-basehtml....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question