Skip to content

Empty Album conditional statement #20

@goldsky

Description

@goldsky

On https://github.com/argnist/Cliche/blob/master/core/components/cliche/controllers/web/Albums.php#L119

I think it's better to have a conditional when there's no cover from an empty album.

if ($obj->Cover) {
    $cover = $obj->Cover->toArray();
    // foreach($cover['metas'] as $k => $v){
        // $name = strtolower(str_replace(' ','',$v['name']));
        // $cover['cover.'. $name] = $v['value'];
    // }
    // unset($cover['id']);
    // unset($cover['metas']);
    $phs = array_merge($phs, $cover);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions