<?php

class Crud_field_name extends Abstract_rtgc_callback
{

    public function column($value = '', $data = [])
    {
        $href = '/assets/uploads/multimedia/';
        if (!empty($data['is_image'])) {
            $href .= 'images/' . $value;
        } else {
            $href .= 'files/' . $value;
        }

        return '<a href="' . $href . '" target="_blank">' . $value . '</a>';
    }

    public function field($name = '', $value = null)
    {
        return (new \Rtgc_input())->field($name, $value);
    }
}