Ismael
(Shalanga)
1
I searched all place and nothing.
Well, I made a ajax request to an action.
I want this action to response with "Content-Type', 'text/javascript;charset=utf-8".
In zend framework I have an example:
$this->getResponse()->setHeader('Content-Type', 'text/javascript;charset=utf-8');
This is because I want execute a javascript that is generated in action.
qiang
(Qiang Xue)
2
Yii doesn't have this. You can use PHP function header() directly.
Ismael
(Shalanga)
4
Quote
Yii doesn't have this. You can use PHP function header() directly.
Well… i don't know.
But it doesn't work.
Inside an action I made this:
header('Content-Type', 'text/javascript;charset=utf-8');
exit;
And it still unaffected!
It's returned: Content-Type: text/html
Is a Yii issue? Can't I overwrite the header for some reason?
qiang
(Qiang Xue)
5
Check PHP manual. You didn't use it correctly.
Ismael
(Shalanga)
6
It's too late. I'm tired.
My mistake, sorry.
Wrong sintax:
header('Content-Type:text/javascript;charset=utf-8');
This is because i was doing a lot of array association.

Ismael
(Shalanga)
7
Sorry again!
I Could not undo my mistake in time!!!