/** * make * @param string $type type of content * @param string $field field of content * @param string $id id of content * @param string $value value of content */ public static function make($type = "text", $field = "", $id = 0, $value = "") { if (is_null(self::$instance)) { self::$instance = new self(); } $obj = self::$instance; $obj->type = $type; $obj->field = $field; $obj->value = $value; if ($field == 'name') { $obj->value = "({$id}) {$obj->value}"; } $obj->id = $id; return $obj->{$type}(); }
</thead> <tbody> <?php if (count($lists)) { $stt = ($lists->getCurrentPage() - 1) * $lists->getPerPage(); ?> <?php foreach ($lists as $item) { ?> <tr> <?php if (!empty($showField)) { foreach ($showField as $field => $info) { $value = isset($info['alias']) ? $item->{$info['alias']} : $item->{$field}; echo AdminGetTypeContent::make($info['type'], $field, $item->id, $value); } } ?> <td> <a href="{{ URL::Route($moduleRoutePrefix.'ShowUpdate',$item['id']) }}" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-pencil"></span> Edit </a> <a href="javascript:;" onclick="deleteItem({{{$item->id}}})" class="btn btn-default btn-sm"> <span class="fa fa-trash-o"></span> Del </a> <a href="javascript:;" onclick="toggleContact({{$item->id}})" class="btn btn-default btn-sm"> <span class="fa fa-eye"></span> Show Contact </a> </td> </tr>