D
D
des1roer2015-03-21 06:27:12
JavaScript
des1roer, 2015-03-21 06:27:12

Yii pass value by reference using POST?

yii has an unknown CHtml::ajaxLink()
but it seems to work with the current page
and I would like to post data to another page

echo CHtml::ajaxLink(
    $text = 'Click me', 
    $url = 'https://toster.ru/question/new', 
    $ajaxOptions=array (
        'type'=>'POST',
        'dataType'=>'json',
        'success'=>'function(html){ jQuery("#des1roer=true").html(html); }'
        ), 
    $htmlOptions=array ()
    );

that is, specify the link ( https://toster.ru/question/new ), post name (des1roer) and value (true)
and display on the final page
if (isset($_POST['des1roer'] ))
       echo $_POST['des1roer'] ;

I think it's somewhere but I can't find it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2015-03-22
@des1roer

options are added to ajaxOptions:
'data' => array( 'des1roer' => '1')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question