How to render plain text?

I tried this but it doesn’t work:


    public function actionTest()

    {

        return "hello";

    }

gee, i really don’t know but there is a “hello world” demo. check it out…

echo?

sorry. I came from asp.net mvc… which you could usually return types… now I get it thank you

If you want to return just text, your mime should be text/plain.

Check your returned content-type header.

You should render it to view like this:




    public function actionTest()

    {

        $text = "hello";

	$this->render('test',array('text'=>$text));

    }



and in the view file:




<?php echo $text; ?>