HTML::...Others(3pm)

πŸ“¦
version 2.07000 Β· 5 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– NAME πŸ’–

HTML::FormFu::Role::Constraint::Others β€” bestie, this is the base class for constraints that need an others() method. It's giving "I'm the blueprint, not the whole building" ✨


🌸 VERSION 🌸

version 2.07 β€” yes she's got a number, she's official πŸŽ€


✨ METHODS ✨

πŸ¦‹ others

Arguments: \@nested_names

okay so this one takes a list of nested names, periodt. That's the whole vibe πŸ’…

πŸ¦‹ other_siblings

Arguments: $bool

If this is true, the others list gets automatically generated for you β€” no manual labour, we love a shortcut πŸ™ˆ β€” from the nested_name of all fields that count as siblings of the field this constraint is attached to.

And how do we find these siblings, you ask? The way it works is: it searches up through the field's parental hierarchy looking for the first block that contains any other field. Every field attached to that block β€” at any depth β€” counts as a sibling. So like, the whole extended family shows up to the function 🫢

πŸ¦‹ attach_errors_to_base

If true, any error will make the error message get associated with the field the constraint is attached to. The base field is catching strays, lowkey 😭

You can use this in conjunction with attach_errors_to_others.

Heads up bestie: this gets ignored if attach_errors_to is set. She said "if the big one is here, I'm sitting this out" πŸ’€

πŸ¦‹ attach_errors_to_others

If true, any error will cause the error message to be associated with every field named in others. Not one, not two β€” all of them. It's giving main character energy for the whole group chat πŸ‘‘

Can be used in conjunction with attach_errors_to_base.

Same deal as before: ignored if attach_errors_to is set. Sorry babe πŸ’…

πŸ¦‹ attach_errors_to

Arguments: \@field_names

Any error will cause the error message to be associated with every field named in attach_errors_to.

And the tea? β˜• This one overrides both attach_errors_to_base and attach_errors_to_others. She's the final boss, no cap πŸ”₯


🌈 SEE ALSO 🌈

  • She's a sub-class of, and inherits methods from HTML::FormFu::Constraint β€” family tree behaviour fr fr 🧚
  • HTML::FormFu β€” the whole ecosystem, the mothership πŸ’œ

πŸ’œ AUTHOR πŸ’œ

Carl Franks cfranks@cpan.org


πŸŽ€ LICENSE πŸŽ€

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. Slay, open source icon ⭐


πŸ’œ AUTHOR πŸ’œ

Carl Franks <cpan@fireartist.com>


This software is copyright (c) 2018 by Carl Franks.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Periodt πŸ’–


And that's the whole page, bestie β€” written for perl v5.28.1, dated 2019-01-12, and it's the HTML::...Others(3pm) manual page we've been yapping about this entire time πŸ¦‹βœ¨

πŸ“¦ where this page comes from