Viewing 1 replies (of 1 total)
  • Thread Starter MasterNs

    (@frile)

    I can list all Gallery names this way:

    <div id="information">
    <h2>
    <?php if ($galleries = $this -> Gallery -> gname()) : ?>
    <?php foreach ($galleries as $gallery_id => $gallery_title) : ?>
    <?php echo $gallery_title; ?>
    <?php endforeach; ?>
    <?php endif; ?>
    </h2>
    <h3></h3>
    <p ></p>
    </div>

    where gname() is function from …/models/gallery.php :

    function gname() {
    $gname = array();
    if ($galleries = $this -> find_all()) {
    foreach ($galleries as $gallery) {
    $gname[$gallery -> id] = $gallery -> title;
    			}
    		}
    return $gname;
    	}

    But how to select just active (current) Gallery title?

Viewing 1 replies (of 1 total)

The topic ‘Display Gallery name’ is closed to new replies.