M
M
Michael2018-12-06 10:15:12
Yii
Michael, 2018-12-06 10:15:12

How to make confirmation of sending a document?

Hello everybody! The essence of the question is as follows, there is a display of information on objects through the GridView on the page, I wrote a function to generate a pdf file for a specific record id, the button works and the document in the form of pdf comes to the mail, everything is fine here, the problem is that when you click on send button - it just reloads the page, but I would like that when you click on the send button, confirmation was first requested, something like: "Are you confirming the sending of the letter?". I tried to solve my problem in the following way, but it didn't work:

[
    'label' => '',
    'value' => function($data){
        if($data['email'] == true){
            return Html::a(
            	'<span>', 
            	Url::to(['order/pdf', 'id' => $data->id]), 
            	[
            		'class' => 'glyphicon glyphicon-envelope', 
            		'title' => 'Отправить документ на email ' . $data->email, 
            		'data' => [
                		'confirm' => 'Вы подтверждаете отправку документа?',
                		'method' => 'post',
            		],
            	]);
        }else{
            return '';
        }
    },
    'format' => 'html',
],

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-12-06
@Bally

Good morning.
Change the format value from html to raw.
'format' => 'raw',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question