[html-formfu] Getting "need a schema or context" loading config file

Carl Franks fireartist at gmail.com
Sat Apr 11 07:35:48 GMT 2009


2009/4/10 Dennis Daupert <ddaupert at gmail.com>:
> I've only recently begun to use FormFu, and this is my first post, so let me
> know if I need to supply more/different/less info.
>
> I'm trying to configure and populate a Select widget in my Catalyst app, but
> keep getting the "need a schema or context" error.

Hi,

If, for example, your schema class is "MyApp::MySchema", then you'd call
    $c->model("MySchema")
to retrieve it.

Use that name in your app config, to tell
Catalyst-Controller-HTML-FormFu to put it in your form stash.
If your app-config is yaml:
'Controller::HTML::FormFu':
  model_stash:
    schema: MySchema

If it's Config::General format, I think it would be:
<Controller::HTML::FormFu>
  <model_stash>
    schema MySchema
  </model_stash>
</Controller::HTML::FormFu>

That'll save the model at $form->stash->{schema}
so it's available to Model-DBIC

Carl



More information about the HTML-FormFu mailing list