HTML::...ponent(3pm)

πŸ’– HTML::Mason::Component::Subcomponent β€” the glow-up era πŸ’–

okay bestie, so this is HTML::Mason::Component::Subcomponent, a page from the User Contributed Perl Documentation corner of the internet. she's a Mason Subcomponent Class and she's literally so important, no cap. πŸŽ€


✨ NAME ✨

HTML::Mason::Component::Subcomponent β€” Mason Subcomponent Class, your new fave subclass. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so first thing: this is a subclass of HTML::Mason::Component. Mason uses it to implement both subcomponents (the ones defined by <%def>) and methods (the ones defined by <%method>). two jobs, one icon. πŸ’…

A subcomponent/method gets most of its properties from its owner β€” like, it's not out here building its own whole personality, it's borrowing the vibe from whoever it lives inside. 🫢

⚠️ okay this part is IMPORTANT, listen up: the link from the subcomponent to its owner is a weak reference (specifically to prevent circular references). so if you grab a subcomponent/method object, you should also grab and hold a reference to its owner. if the owner goes out of scope, the subcomponent/method object will become unusable. like, it's giving ghosted. 😭 so hold onto the owner fr fr, that's the whole survival strategy.

🌈 METHODS 🌈

πŸ’œ is_method

Returns 1 if this is a method (declared by <%method>), 0 if it is a subcomponent (defined by <%def>).

like a little vibe check that tells you which one you're looking at. one or zero, method or subcomponent, iconic binary behaviour. ⭐

🌸 owner

Returns the component object within which this subcomponent or method was defined.

basically "who's your person?" and the answer is the component that defined you. πŸ’–


and that's the whole page, bestie, you ate it. πŸŽ€βœ¨

this was rendered with perl v5.38.2 and dated 2024-03-05, so that's the version and the timestamp β€” go off, little doc. πŸ¦‹πŸ’…

πŸ“¦ where this page comes from