shoppingmallv2 init...

This commit is contained in:
최준흠 2023-08-08 11:06:01 +09:00
parent 84520c345c
commit c764a7f347
4 changed files with 6 additions and 4 deletions

View File

@ -13,6 +13,7 @@ abstract class AdminController extends BaseController
{
parent::initController($request, $response, $logger);
$this->_viewPath = 'admin/';
$this->_viewDatas['control'] = 'admin';
$this->_viewDatas['layout'] = LAYOUTS['admin'];
}
}

View File

@ -16,6 +16,7 @@ abstract class FrontController extends BaseController
{
parent::initController($request, $response, $logger);
$this->_viewPath .= 'front/';
$this->_viewDatas['control'] = 'front';
$this->_viewDatas['layout'] = LAYOUTS['front'];
}

View File

@ -17,14 +17,14 @@ abstract class BaseEntity extends Entity
return $this->attributes[$field];
}
//파일관련 Field전용
final public function getFileDownload($url = false, $field = "upload_file")
final public function getFileDownload($url, $field = "upload_file")
{
if (is_null($this->attributes[$field])) {
return "";
}
$files = explode(DEFAULTS['DELIMITER_FILE'], $this->attributes[$field]);
return anchor(
current_url() . "/download/{$field}/{$this->getPrimaryKey()}",
$url . "/download/{$field}/{$this->getPrimaryKey()}",
ICONS['IMAGE_FILE'] . $files[0],
["target" => "_self"]
);

View File

@ -94,10 +94,10 @@ function getFieldView_BoardHelper($field, $entity, array $viewDatas)
break;
case 'board_file':
case 'upload_file':
return $entity->getFileDownload($field);
return $entity->getFileDownload(base_url() . $viewDatas['control'] . '/board', $field);
break;
case 'photo':
return $entity->getFileImage($field, 'middle');
return $entity->getFileImage('middle', $field);
break;
case 'view_cnt':
return number_format(!$value ? 0 : $value);