Author Topic: Have you ever output a $form array?  (Read 4883 times)

Offline dhigz

  • Newbie
  • *
  • Posts: 45
  • Karma: +16/-0
    • View Profile
Have you ever output a $form array?
« on: August 02, 2016, 01:40:40 AM »
Have you ever output a form array? (print_r(array_values($form))) I did. It's huge as every element has the entire registry in the array.

If you want to try it, be careful as it will eat up your memory. Make a form with one form element just to see.

So AbanteCart gurus, can you tell me why every form element includes the entire registry as one of it's array values? There must be some valid reason to have all of this overhead every time you output a form.

Don
Don Higbee

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Have you ever output a $form array?
« Reply #1 on: August 02, 2016, 05:41:41 AM »
every form field element is an object, not array!
Do output it use type casting. for ex. var_dump( (string) $form['fields']['some_field_name']));

“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

 

Powered by SMFPacks Social Login Mod