PDF::F...itional(3pm)
π 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 β ifNAMEis not specified, the conditional will consider to always fail. so like, no name, no service πOPβ defaults to==(numeric equality, for the uninitiated). ifVALUEis specified, this is howNAMEandVALUEget compared. andOPcan 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, thenOPwill 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 noVALUEattribute, then this is what gets checked.IScan be either'FALSE'or'TRUE'. the boolean ofNAMEwill be compared and the conditional will branch appropriately. and ifNAMEhas no value, this will fail. harsh? maybe. fair? absolutely πNONEβ if there's noISand noVALUE, then an attempt will be made to find the variable defined byNAME. 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
- debian trixie: libpdf-fromhtml-perl 0.34-1 Β· CC0-1.0
- ubuntu resolute: libpdf-fromhtml-perl 0.34-1 Β· CC0-1.0
- ubuntu stonking: libpdf-fromhtml-perl 0.34-1 Β· CC0-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms