Hello, I have a input/checkboxes selection:
$colaz_label = elgg_echo ('Select ....:');
$colaz_input = elgg_view ('input/checkboxes', array (
'align' => 'horizontal',
'value' => array(),
'disabled' => false,
'options' => array(
'ex1'=> elgg_echo ('ex1'),
'ex2'=> elgg_echo ('ex2'),
'ex3'=> elgg_echo ('ex3'),
'ex4'=> elgg_echo ('ex4')
),
'name' => 'colaz',
));
If i select more than one element, in output it shows me "Array" and not the selected elements.
How could I do if I want to show every selected element by an array in this instraction??
$body.= "<label>" . elgg_echo("Food") . "</label>: " . $blog->colaz . "<br />";
Thank you!!!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
Plz it's important! Thank you
put into
'value' => array(),
Mmm, how exactlely?
use foreach loop e.g.
foreach($blog->colaz as $value){
echo elgg_echo($value);
}
I already use an IF ELSE depending on the choice you make about input/radio... how I put this foreach loop inside it?
Thank you!!
$body .= "<label>" . elgg_echo("What I had") . "</label>:";
switch ($blog->food) {
case 'breakfast':
echo implode(', ', $blog->colaz);
break;
case 'lunch':
echo implode(', ', $blog->pranz);
break;
default:
echo implode(', ', $blog->cen);
break;
}
echo "<br>";
There's a problem: it shows me the selected elements, but it doesn't put them next the "What I had" label but out of the body, under the title. Thank you anyway.
heh, well I can't hold your hand the whole way now can I? :)
You're right :) but can you give me this last help? Please :) :) thank you!!!
I solved the problem by myself :) thanks for all!!
- Previous
- 1
- 2
- Next
You must log in to post replies.