Saving XML from a template Yii


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
3 views
Good afternoon. Needed to give the user the XML file.
Work in yii. For convenient made a few basic templates and fill them with information.
Generate decided using $this->render('export_xml', array('data'=>$data));
In this regard, there are questions. render default loads the main layout, I want to avoid.
Decided this question made an empty layout and $this->layout = '//layouts/blank'; But I think that is more logical and correct decision, only to find it can't yet.
And second, the most important question. Is it possible to force to give the template file?
by | 3 views

3 Answers

0 like 0 dislike
So the layout didn't load to try and use renderPartial():
\r
$this->renderPartial('export_xml', array('data'=>$data)); 

\r
Is it possible to force to give the template file?

What do you mean?
by
0 like 0 dislike
And then do the pattern?
Is despite the fact that
$this->layout = false; In the controller.
And then put any headres, such as those that xml file and print out anything.
by
0 like 0 dislike

header('Content-Description: File Transfer'); header('Content-type: text/xml'); header('Content-Disposition: attachment; filename=filename.xml'); 
by

Related questions

0 like 0 dislike
7 answers
0 like 0 dislike
4 answers
asked Mar 28, 2019 by Alexufo
0 like 0 dislike
2 answers
0 like 0 dislike
6 answers
110,608 questions
257,186 answers
0 comments
27,978 users