Цю сторінку ще не перекладено українською, тому нижче англійська версія.

text_padded() table()

A text column indented by the level of the row, for trees such as categories or menus.

table()->text_padded($name, $extra = [])

Опції

ОпціяЗначення
(text options)Every option of text(); padding is set.

Приклад

Назва
Furniture
└Chairs
└Office chairs
Lighting

Код

$rows = [
    1 => ['id' => 1, 'name' => 'Furniture', 'level' => 0],
    2 => ['id' => 2, 'name' => 'Chairs', 'level' => 1],
    3 => ['id' => 3, 'name' => 'Office chairs', 'level' => 2],
    4 => ['id' => 4, 'name' => 'Lighting', 'level' => 0],
];
return table($rows, ['no_pages' => 1])->text_padded('name');

Примітки

  • The rows need a level field (0 for the top); each level indents 20px with a corner mark.

Див. також: table/text, table/input