Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

question

posted by anonymous 9 years ago
if ($item->getMedia()) {
                fSession::set("media", '
                <input type="hidden" name="existing-media" value="' . $item->encodeMedia() . '" />
                <input type="hidden" name="delete-media" value="0" />
                Fisier existent: <a href="' . $item->prepareMedia(TRUE) . '">' . $item->prepareMedia() . '</a>
                <label for="item-delete-media">Delete existing uploads</label>
                <input type="checkbox" id="item-delete-media" name="delete-media" value="1" />');
            } else {
                fSession::delete("media");
            }

it's there a way to not receive an error if Media field not exist besides try catch?

Yes, using fSchema through fORMSchema.

$column_info = fORMSchema::retrieve()->getColumnInfo('table_name');
if (isset($column_info['media'])) {
    // 
}
posted by wbond 9 years ago