Dancer2...sConfig(3)

πŸ“¦
version 2.2.1 Β· 3 versions
, in fedora 44

✨ NAME ✨

Dancer2::Core::Role::HasConfig β€” it's the role that holds all the config of a Dancer2 App πŸ’– (you'll also see it filed under Dancer2...sConfig(3) in the User Contributed Perl Documentation, iykyk)


πŸŽ€ VERSION πŸŽ€

version 2.2.1 β€” fresh, iconic, current ✨


πŸ’… DESCRIPTION πŸ’…

okay so bestie, listen. This role hands you a config attribute, and that's literally the thing you use to read the configuration. 🫢

Here's the little plot twist: the very first time you touch it, it calls a method called _build_config(). And that method? it has to be implemented by the class that's using this role β€” no skipping, no shortcuts, it's giving main character responsibility. 😀

What should _build_config() give back? The whole config β€” the entire thing, the full vibe β€” the one that's been created by running one or more ConfigReader packages. All of them. Together. That's the assignment. πŸ’–

It also gives you a setting() method, and that one is supposed to be used by externals β€” so things outside your app β€” to read and write config entries. Yes, read and write. She does both. πŸ‘‘


🌸 ATTRIBUTES 🌸

config

Returns the whole configuration. That's it, that's the whole job, and she ate. πŸ’…


πŸ¦‹ METHODS πŸ¦‹

settings

Alias for config. Literally equivalent to <<$object->config>>. Same energy, different name. πŸŽ€

setting

Get or set an element from the configuration. Read it, write it, whatever you need β€” she's flexible like that. ✨

has_setting

Verifies that a key exists in the configuration. The vibe check for your keys β€” does it exist or not, bestie, we're about to find out. πŸ‘€


πŸ’œ AUTHOR πŸ’œ

Dancer Core Developers β€” the legends themselves. 🫢


This software is copyright (c) 2026 by Alexis Sukrieh.

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

no cap, that license part is the real deal β€” same terms as Perl 5 itself, fr fr. 🌈

and that's the whole page, bestie!! πŸŽ€βœ¨ this one's from perl v5.42.3, dated 2026-09-20 β€” go forth and configure your heart out, ily πŸ’–πŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from