Using form helper with array values

I’ve created a package of Templates for the core Search Block. In these view files, I’d like to move to using the form helper vs html markup for the inputs.

This works:
<input name="search_paths[]" type="hidden" value="<?php echo h($search_path, ENT_COMPAT, APP_CHARSET); ?>" />

This does not:

<?php $form->hidden('search_paths[]', h($search_path, ENT_COMPAT, APP_CHARSET)); ?>

I ran into this issue (inputs with array values) developing a page list addon, but was able to do it differently with some serialization etc in the block controller. All I could devise in that case was, using the form helper, the naming with the brackets, “[]”, would simply not work.

Anyone have any pointers on getting this to work properly, or how it should be done to begin with??

You need to echo $form

Happy morning facepalm. Here come the Templates… And a :coffee: :smiley:

I only know that because I have often made the same mistake :wink:

I’ve noticed a certain correlation with the time taken to find the error and asking a public question on a forum - you spend hours trying to find the stupid error all in vain but as soon as you post a question on a forum you solve it within minutes. Therefore, don’t be afraid to post stupid question ASAP :grinning: :grinning: :grinning:

Another thing I’ve noticed is the more time you spend on an error which should not simply be there the greater the chance the error is the most stupid one but you’re looking at the wrong side. Therefore, the more stupid the error the harder it is to find :rofl:

@linuxoid Tell me about it! I spent about 3 days staring at it in my free time before I asked. Figured it would be something dumb lol. I’m a lone ranger out here doin concrete. I’m not employed doing it, and have zero people in my life that understand it, let alone want to try to answer my questions in regards. Simple lack of another soul to review my work, I give it all I got until it works. I walked into the Concrete world a little over 10 years ago dumb as a box of web developing rocks. And today, I’ll still take an L for the team :rofl: because if it wasn’t for the team we wouldn’t be discussing this right now! The W comes, thanks to @JohntheFish quick response, when this free package is in the marketplace in a few days :wink: