Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- .env
- 고도몰튜닝
- csrf-token
- nginx
- pyinstaller
- jwt
- curl
- Synology
- access-token
- cors
- 언어도단
- codeigniter
- 라라벨
- revert
- 웹서버구축
- 코드이그나이터
- 환경변수숨김
- window.open()
- 고도몰
- guzzle
- Laravel
- gitignore
- 트러블슈팅
- 루멘
- git
- 디버그페이지
- 구즐
- 맛집리스트
- Post
- WSL
Archives
- Today
- Total
Six_Cool's 작업창고
고도몰5 튜닝 컨트롤러 기본 : Data Handling, View Renderin 본문
아래 링크 참고 Data Handling, View Rendering
http://doc.godomall5.godomall.com/Learning_More/Controller
Controller - Godomall5
Controller Controller 실행 순서 controller는 framework의 구동을 제외한 솔루션의 기본 공통 작업부터 화면 출력까지의 업무를 관장합니다. view(템플릿 엔진) 설정 Setup() 해당 화면에서 사용될 interceptor 설
doc.godomall5.godomall.com
View Rendering
view 출력 예제
<?php
namespace Bundle\Controller\[Front|Admin|Mobile]\Test;
class MyController extends \Controller\[Front|Admin|Mobile]\Controller {
public function index() {
// somecode or data handling
}
}
리다이렉트 예제
<?php
namespace Bundle\Controller\[Front|Admin|Mobile]\Test;
class MyController extends \Controller\[Front|Admin|Mobile]\Controller {
public function index() {
$this->redirect('../order/cart');
}
}
JSON 출력 예제
<?php
namespace Bundle\Controller\[Front|Admin|Mobile]\Test;
class MyController extends \Controller\[Front|Admin|Mobile]\Controller {
public function index() {
// case 1
$this->setData('wrapper', [
'test1' => 1,
'test2' => 2,
'test3' => 3,
]);
$this->json();
// case 2
$data = [
'wrapper' => [
'test1' => 1,
'test2' => 2,
'test3' => 3,
]
]);
$this->json($data);
}
}
파일 다운로드 예제
<?php
namespace Bundle\Controller\[Front|Admin|Mobile]\Test;
class MyController extends \Controller\[Front|Admin|Mobile]\Controller {
public function index() {
// 파일경로와 파일명을 인자로 넘기면 즉시 다운로드가 실행
$this->download(UserFilePath::frontSkin('mera_ws','img','btn_19out.gif'), 'sample_test.gif');
}
}
스트림 파일 다운로드 예제
<?php
namespace Bundle\Controller\[Front|Admin|Mobile]\Test;
class MyController extends \Controller\[Front|Admin|Mobile]\Controller {
public function index() {
$this->redirect('../order/cart');
}
}
Comments