how to get php list output into inline layout

i have a list output on a php page.

but i want the list layout show in inline-block style.
How can I do this?

this is my code so far...

bx_import('BxDolService');
list($sRecords) = BxDolService::call('business', 'index_page', array('recent'));

<div class="bodyLeftBlock_business_pages_links_one"><?= $sRecords ?></div>

result is:

item_1

item_2

etc..

instead of item_1   item_2   item_3

any help is welcome :-)

Quote · 5 Oct 2013

You need to loop through the items individually so they can be wrapped inside a floated div.

bx_import('BxDolService');
list($sRecords) = BxDolService::call('business', 'index_page', array('recent'));
echo '<div class="bodyLeftBlock_business_pages_links_one">';
foreach($sRecords as $id => $value) {
    echo '<div style="padding: 4px; float: left;">' . $value . '</div>';
}
echo '<div class="clear_both"></div>';
echo '</div>';

I am just guessing on this as i am not sure of the exact content of $sRecords.

You may need to do something like this instead.

bx_import('BxDolService');
$aArray = list($sRecords) = BxDolService::call('business', 'index_page', array('recent'));
echo '<div class="bodyLeftBlock_business_pages_links_one">';
foreach($aArray as $id => $value) {
    echo '<div style="padding: 4px; float: left;">' . $value . '</div>';
}
echo '<div class="clear_both"></div>';
echo '</div>';

But i do not know if $sRecords is just a string or an array of values. So maybe none of those examples will work.


https://www.deanbassett.com
Quote · 5 Oct 2013

thanks deano, i will try the example you gave me.

it returns a array not a string.

 

Quote · 5 Oct 2013

Pitty, it did not work :-(

any other ideas...

Quote · 5 Oct 2013

Based on what you had originally, it is a string. If it was an array, Then your code as written would output the word Array(). Instead your seeing a list. So it would appear it is a string with a new line.

But without knowing the exact format of the string that is returned i cannot help.

can you just echo out the result of the service call

echo BxDolService::call('business', 'index_page', array('recent'));

And tell me what you see.

I have to know the exact format before i can write code to process it.

https://www.deanbassett.com
Quote · 5 Oct 2013

 

Thanx deano,

it worked :-) it was a array of details.

Based on what you had originally, it is a string. If it was an array, Then your code as written would output the word Array(). Instead your seeing a list. So it would appear it is a string with a new line.

But without knowing the exact format of the string that is returned i cannot help.

can you just echo out the result of the service call

echo BxDolService::call('business', 'index_page', array('recent'));

And tell me what you see.

I have to know the exact format before i can write code to process it.

 

Quote · 6 Oct 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.