Tilak Tilak - 9 months ago 44
PHP Question

Two Actions from one action PHP-Yii Framework

I have two actions need to run at a time from one controller. first thing pdf download(force download),and show simple thank you message.these two actions are working fine. but when I placed in action only one action is successfully executed.but I want two actions executed with only one button/link.

public function actionThankYou()
$this->actionPdf(); //action
$this->render('thankyou'); // rendering thankyou view page


echo CHtml::link('Save & Submit',array('EjfoOrgRecruiting/thankYou'));

am I following correct procedure or not? suggest me best way to do that.


I got solution for this..

    public function actionThankyou()

in the thankyou view I wrote to refresh page after 2 secs. like this

header('Refresh:2;url='. $this->createUrl('site/pdf'));