Widget prints extra content, why?

Hi all!

I’ll try to write my problem with many details, but I can’t show all of my codes.

First of all, here is the view, add.php which contains a widget:




<div class="box grid_8 round_all"><?php $this->widget('application.components.global.widget.AddOrder',array('form'=>$form));?></div>



Here is the run function of the widget php, which is important:




public function run()

	{

		switch(Yii::app()->user->partner_group_id)

		{

			case PartnerGroupType::_DEFAULT:

				$order_default=new OrderDefault();

				$this->_string=$this->render('application.views.order._addGlobalFreight',array(

					'order_default'=>$order_default,

					'form'=>$this->form

				));

				break;

		}

	}



And here is the widget template first line:


<h2 class="box_head grad_colour">

More info for the template: the first line hasnt got any character before the h2 opening tags.

My problem is, when I see the source of the page, the widget generates some extra character which is my problem in the design. I have tried var_dump the render function result in the run function, and I saw these characters before the var_dump content!

I have attached a screenshot.

My question is, what is that? Where is the bug?

Many thanks!

mudlee

Is there anything in the AddOrder class before teh declaration maybe, or after? can you attach that class please?

Nothing. The class has a private $_string(which contains the render result) and public $form (which comes from the add.php). Thats all.

do you try to user renderPartial instead?

There is no renderPartial in a widget… is there?

Yes, we can’t use it.

I have tried an another thing, but it is very … I can’t find the word :D

So, i put into the template a simple text, for example: "ASD"

with this simple text, it’s ok, I don’t see the wrong characters.

But when I start the template with a html tag… I don’t understand… :)

I’ve attached a screenshot again

I saved the page, and in the source, I found this: ďťżďťż

But I didn’t put into my code? I don’t know where is it…

I found the problem… the view file starting with these characters…