ZenDB and images

3 posts by 2 authors in: Forums > CMS Builder
Last Post: November 27, 2024   (RSS)

I am correct that ZenDb does not return images as part of its record set and that we should use getRecords when we want images.

Jeff Shields
yaadev.com

By Dave - November 27, 2024

Hi Jeff, 

We've now got this built into the latest CMSB beta.  Here's what you can do in the beta instead of the above code: 

$records = DB::select('articles');
foreach ($records as $record) {
    echo "<h1>$record->name</h1>\n";  
    foreach ($record->load('uploads') as $upload) {
        echo "<img src='$upload->urlPath'><br>\n";
    }
}

If you get a chance to try it out let us know any feedback.  Thanks!

Dave Edis - Senior Developer
interactivetools.com