More on SSE and Yii

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.

next (#2) »

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.