views:

47

answers:

2

It's a kind of UI second flavor,

function UISecond($elements)
{

}

So that this functions shows the specified elements(with name,id and type) which is neccesary,but not too picky about how exactly it's displayed.

EDIT

Give it an array,output the HTML.

Anyone has tried this?

EDIT AGAIN

I want to develop a render engine like drupal's,which takes the array as parameter,and outputs the HTML automatically.

A: 

Are you talking about something like this?

function UISecond($elements)
{
    foreach($elements as $_elem)
    {
        echo "<{$_elem['type']}";
        foreach($_elem['attribute'] as $_name => $_contents) {
            echo " {$_name}=\"{$_contents}\"";
        }
        echo ">{$_elem['innerHTML']}</{$_elem['type']}>";
    }
}

Either way, half of getting a good answer is writing a good problem description ;-)

Atli
I want the function to automatically do the layout work.
Mask
A: 

I think you're looking for Krumo.

Pekka