UR::Ob...t::Html(3pm)
okay so bestie, you just opened UR::Ob...t::Html(3pm) and honestly? it's a lil guy but it's an important lil guy. it's giving "HTML views of objects" energy and we're gonna walk through it together, no cap. π
β¨ NAME β¨
UR::Object::View::Default::Html β represent object state in HTML format πΈ
like, literally what it says on the tin. it takes an object and renders its state as HTML. iconic behavior honestly.
π SYNOPSIS π
here's the whole vibe, verbatim, don't @ me:
#####
package Acme::Product::View::OrderStatus::Html;
class Acme::Product::View::OrderStatus::Html {
is => 'UR::Object::View::Default::Html',
};
sub _generate_content {
my $self = shift;
my $subject = $self->subject;
my $html = ...
....
return $html;
}
#####
$o = Acme::Product->get(1234);
$v = $o->create_view(
perspective => 'order status',
toolkit => 'html',
aspects => [
'id',
'name',
'qty_on_hand',
'outstanding_orders' => [
'id',
'status',
'customer' => [
'id',
'name',
]
],
],
);
$html1 = $v->content;
$o->qty_on_hand(200);
$html2 = $v->content;
so like, you subclass it with is => 'UR::Object::View::Default::Html', you write your own _generate_content that grabs $self->subject and hands back some $html, and then you can create_view on an object with a perspective, a toolkit => 'html', and a whole nested aspects list. then $v->content gives you the HTML. change the object ($o->qty_on_hand(200)), grab $v->content again, boom β fresh view. π
π¦ DESCRIPTION π¦
so this class implements basic HTML views of objects. that's the whole thing. it's got standard behavior for all text views β nothing extra, nothing weird, just the solid baseline you build your cute custom HTML on top of. β¨
π SEE ALSO π
go read your sisters, bestie, they're all right here:
UR::Object::View::Default::TextUR::Object::ViewUR::Object::View::Toolkit::XMLUR::Object::View::Toolkit::TextUR::Object
and that's the whole page, periodt π«Ά this one's running on perl v5.32.1 and the docs got stamped 2022-01-17 β so yeah, vintage but still serving. go build something pretty. πβ¨π
π¦ where this page comes from
- debian bookworm: libur-perl 0.470+ds-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libur-perl 0.470+ds-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libur-perl 0.470+ds-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms