krakjoe / ui

Cross platform UI development in PHP
Other
519 stars 39 forks source link

[idea] return $this in void method to allow chained calls #14

Open remicollet opened 7 years ago

remicollet commented 7 years ago

Perhaps stupid, just an idea, to be able to write

$bos = new Box(Box::Vertical)
    ->setPadded()
    ->append(new Combo()
        ->append("Item 1")
        ->append("Item 2")
        ->append("Item 3"))
    ->append(new Separator(Separator::Horizontal))
    ...

Thus, not having to give a name to each UI item.