You are viewing revision #1 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.
This is not actually Yii involved.
In this SSE wiki. This was really good. But there was few bugs. Someone might can't figure out what is it. After long long reading on SSE and yii controller I got it working.
Here are few tips before writing. Always try to use " " for echo or print. SSE recognizes server response end line by "\n", and for PHP echo '\n'; and echo "\n"; are two different meaning. "\n" = line break, '\n' echoes '\n' string. After every data or command always end line with "\n".
configuring server response time...
echo "reply: 2000 \n";
response data ...
echo "data: Hello World \n";
Remember! response data behind "data:" must be in 1 line or row. For example: echo 'data: '.$this->renderpartial('_view',array('data'=>$data),true);
In this case, in [_view] file html tags MUST be stacked and no whitespace allowed.
If anything you needed more, ask free and don't hesitate.
Useful
This is useful information, but I suggest you spend a little more time explaining in greater detail. As it is written now, it is a little difficult to follow for newcomers.
@trond, Thank you for your feedback.
It was the first time I'm writing an article. I'll update it as soon as fast. Next time I'll try to implement whole technique. Thanks again :).
Update Information
Sorry guys. There have been a problem and i can't solve that. when the application language is set to UTF8 language i.e "mn". SSE can not send to browser. When I find out this solution for this bug, I'll update this as soon as possible.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.