Skip to content

Commit

Permalink
feat: use new fn mode API
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Aug 17, 2024
1 parent 86ecc5c commit 0ee4911
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
*/
function form(): \Leaf\Form
{
if (!(\Leaf\Config::get('form.instance'))) {
\Leaf\Config::set('form.instance', new \Leaf\Form());
if (!(\Leaf\Config::getStatic('form'))) {
\Leaf\Config::singleton('form', function () {
return new \Leaf\Form();
});
}

return \Leaf\Config::get('form.instance');
return \Leaf\Config::get('form');
}
}

0 comments on commit 0ee4911

Please sign in to comment.