widgets indentation

Always when I use widgets, it put it at the beginning of the page, and the indentation in the code…

Is there some way to say for example to the zii.widgets.CMenu, to keep indentation or something?

or it must put all it’s code like




				<span class="arrow2"></span>

			</section>

				<ul id="top-menu">

<li class="active"><a href="/yii/www/index.html">index</a></li>

<li><a href="/yii/www/login.html">login</a></li>




Well unless you are using an old version of Internet Explorer the indentation of the markup shouldn’t present a problem. If it is just hard to read when viewing source, you could always hook into HTML Tidy or something like that.

It is impossible and actually not needed. Actually I would prefer to remove any indentation for several reasons ;) Use a browser built-in functionality to view DOM tree (Opera, FF and Chrome have some nice stuff to do that).

Sometimes poeple judge you coding skills by your indentation… and if your indentation *ucks…

They might think you are not that good…

Widgets indentation it’s not the main concernt…

The main concern is scripts in header

Sure, PHP code must have indentation, but not the final HTML code. It’s almost impossible to control it when you have lots of widgets and PHP code mixed with HTML. And people who think it’s not good probably don’t understand that, so why should you care about their opinion? :) Take a look at the Google.com source code. Perfect HTML! :lol:

I would love to hear about a solution about this. But as said before: Its not possible by the way how the PHP interpreter works. At least i do not know a solution for this.

One might use ASP.NET technology to achieve that goal.

See http://www.wacom.eu/ for a great HTML indentation [ASP.NET].

Also http://eu.battle.net/en/ seems to manage identation at a rough level [Spring/Java].