[html-formfu] load_config_file in the middle of YAML

Jason Kohles email at jasonkohles.com
Wed Oct 10 12:57:36 GMT 2007


On Oct 10, 2007, at 7:02 AM, Ruben Fonseca wrote:

> Hi!
>
> I'm trying to use the load_config_file in the middle of a YAML  
> specification to load some common form widgets from another file,  
> but so far I've been unsuccessful.
>

When you use load_config_file, it inserts the contents of the loaded  
configuration file at the same level where the call was, so what you  
are doing ends up getting parsed something like this:

---
action: /foo
elements:
   - type: Text
   - elements:
      - type: Text
   - type: Submit

If /foo/file just contains the elements that you want inserted at  
that point, then you can take out the elements:, move everything else  
up a level and do it like this:

---
action: /foo
elements:
   - type: TExt
   - load_config_file: /foo/file
   - type: Submit

---
- type: Text

>
> This generates an error "an't locate object method "elements" via  
> package "HTML::FormFu::Element::Text" at /opt/local/lib/perl5/ 
> site_perl/5.8.8/HTML/FormFu/ObjectUtil.pm line 264", so I'm certain  
> I did something wrong.
>
> Can you tell me the proper way to do this please?
>
> thank you!
> Ruben
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.rawmode.org
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>

-- 
Jason Kohles
email at jasonkohles.com
http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire





More information about the HTML-FormFu mailing list