stars(), stars_select() form()

A rating: stars() shows the value as stars, stars_select() lets the visitor pick one with radio stars.

form()->stars($name = '', $desc = '', $extra = [], $replace = [])
form()->stars_select($name = '', $desc = '', $extra = [], $replace = [])

Options

OptionMeaning
stars, maxNumber of stars (5); value of a full row (5).
color_ok, color_ko, class, class_ok, class_koColours and classes of lit and dim stars (stars()).

Example

Code

return form(['rating' => 4, 'your_rating' => 3])
    ->stars('rating')
    ->stars_select('your_rating', 'Your rating');

See also: table/stars