PDF::F...itional(3pm)

πŸ“¦
version 0.34 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– PDF::FromHTML::Template::Container::Conditional πŸ’–

okay bestie, welcome to the Perl docs, specifically the User Contributed Perl Documentation corner of the internet, and specifically specifically the page for PDF::FromHTML::Template::Container::Conditional(3pm). yes that's a long name. yes it's iconic. let's go 🫢


✨ NAME ✨

PDF::FromHTML::Template::Container::Conditional β€” it conditionally allows children to render. that's it, that's the whole job, and it does it flawlessly πŸ’…


πŸŽ€ NODE NAME πŸŽ€

CONDITIONAL and also IF which is literally just an alias for CONDITIONAL. two names, one queen πŸ‘‘


🌸 INHERITANCE 🌸

PDF::FromHTML::Template::Container β€” so it's inheriting from Container, as one does. family lineage ✨


πŸ’œ ATTRIBUTES πŸ’œ

  • NAME β€” Required. this is a parameter name, and its value is what decides whether the conditional passes or fails. and listen β€” if NAME is not specified, the conditional will consider to always fail. so like, no name, no service πŸ™ˆ
  • OP β€” defaults to == (numeric equality, for the uninitiated). if VALUE is specified, this is how NAME and VALUE get compared. and OP can be any of the 6 numeric comparison operators or the 6 string comparison operators. six and six, balanced, we love to see it ⭐
  • VALUE β€” if you specify this, then OP will be checked. this is a standard attribute, so if you want a parameter, prepend it with '$'. yes literally the dollar sign. don't forget it bestie 😭
  • IS β€” if there's no VALUE attribute, then this is what gets checked. IS can be either 'FALSE' or 'TRUE'. the boolean of NAME will be compared and the conditional will branch appropriately. and if NAME has no value, this will fail. harsh? maybe. fair? absolutely πŸ’€
  • NONE β€” if there's no IS and no VALUE, then an attempt will be made to find the variable defined by NAME. if it exists and is true, the condition will succeed. otherwise, it will fail. that's the whole vibe check 🌈

πŸ¦‹ CHILDREN πŸ¦‹

None. no kids. child-free by choice 🧚


πŸ’… AFFECTS πŸ’…

Nothing. zero impact. it's giving minimalism ✨


🌟 DEPENDENCIES 🌟

None. fully self-sufficient main character energy πŸ‘‘


πŸ“ USAGE πŸ“

here's how you actually use it, bestie:

<if name="__PAGE__" OP="!=" VALUE="__LAST_PAGE__">
  ... Children execute if the current page is not the last page ...
</if>

<if name="Param1" OP="eq" VALUE="$Param2">
  ... Children execute if Param1 is string-wise equals to Param2 ...
</if>

see how the children only execute when the condition slays? that's the whole thing. note the OP="!=" for the numeric not-equal and OP="eq" for the string-wise equals. do not mix those up or you WILL be debugging at 2am 😭


πŸ’– AUTHOR πŸ’–

Rob Kinyon (rkinyon@columbus.rr.com) β€” thank you for your service, legend 🫢


🌸 SEE ALSO 🌸

...nothing listed here. the section is empty. it's giving mysterious. iykyk πŸ™ˆ


fr fr, that's the whole page. no cap.

perl v5.38.2 Β· 2024-07-28 Β· and that's the footer bestie, we made it to the end πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ‘‘πŸŒˆβ­

πŸ“¦ where this page comes from