Hot answers tagged

2

The Craft Form Macro file is in the Craft package. The forms.html file is the macro file, and that file loads several other templates depending on which form macro is being used. vendor/craftcms/cms/src/templates/_includes/forms.html You can see the individual files in this directory: vendor/craftcms/cms/src/templates/_includes/forms/ Unfortunately, there ...


1

Make sure you are importing the SproutForms base class into your php file. The code below assumes you'd be using the namespace of your actual custom module and class: <?php namespace modules/mycustommodule; use barrelstrength\sproutforms\SproutForms; class MyCustomClass { public function myCustomMethod() { $formHandle = 'my-form-handle'; $...


1

The error indicates that SproutForms::$app is not an object, which would mean it has not been initialized yet. If you look at the source code, you can see that SproutForms::$app is a static property on the SproutForms class that starts out undefined. It's only assigned the current App instance once it's init method has been executed. The static property ...


Only top voted, non community-wiki answers of a minimum length are eligible