
Yaf_Controller_Abstract::redirect 함수는 Controller Aspect에서 페이지를 리다이렉트 시키는 함수입니다.
redirect 함수의 파라미터는 두 가지 종류가 있습니다.
1. string: 리다이렉트할 URL을 지정합니다. 예를 들어, 'index/index' 또는 '/index/index'를 지정합니다.
2. array: 리다이렉트할 URL과 매개변수를 지정합니다. 예를 들어, array('controller' => 'index', 'action' => 'index')를 지정합니다.
redirect 함수를 사용하여 페이지를 리다이렉트 시키는 방법은 다음과 같습니다.
1. redirect 함수를 호출합니다.
2. redirect 함수에 리다이렉트할 URL 또는 매개변수를 지정합니다.
redirect 함수를 사용한 예시 코드는 다음과 같습니다.
#hostingforum.kr
php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL을 지정합니다.
$this->redirect('index/index');
}
}
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL과 매개변수를 지정합니다.
$this->redirect(array('controller' => 'index', 'action' => 'index'));
}
}
redirect 함수의 사용법은 다음과 같습니다.
1. redirect 함수를 호출합니다.
2. redirect 함수에 리다이렉트할 URL 또는 매개변수를 지정합니다.
redirect 함수의 사용 예시를 다음과 같이 설명할 수 있습니다.
#hostingforum.kr
php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL을 지정합니다.
$this->redirect('index/index');
}
}
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL과 매개변수를 지정합니다.
$this->redirect(array('controller' => 'index', 'action' => 'index'));
}
}
redirect 함수를 사용하여 페이지를 리다이렉트 시키는 방법은 다음과 같습니다.
1. redirect 함수를 호출합니다.
2. redirect 함수에 리다이렉트할 URL 또는 매개변수를 지정합니다.
redirect 함수를 사용하여 페이지를 리다이렉트 시키는 방법에 대해 다음과 같이 설명할 수 있습니다.
#hostingforum.kr
php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL을 지정합니다.
$this->redirect('index/index');
}
}
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL과 매개변수를 지정합니다.
$this->redirect(array('controller' => 'index', 'action' => 'index'));
}
}
redirect 함수의 사용 예시 코드를 다음과 같이 설명할 수 있습니다.
#hostingforum.kr
php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL을 지정합니다.
$this->redirect('index/index');
}
}
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL과 매개변수를 지정합니다.
$this->redirect(array('controller' => 'index', 'action' => 'index'));
}
}
redirect 함수를 사용하여 페이지를 리다이렉트 시키는 방법에 대해 다음과 같이 설명할 수 있습니다.
#hostingforum.kr
php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL을 지정합니다.
$this->redirect('index/index');
}
}
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL과 매개변수를 지정합니다.
$this->redirect(array('controller' => 'index', 'action' => 'index'));
}
}
redirect 함수를 사용하여 페이지를 리다이렉트 시키는 방법에 대해 다음과 같이 설명할 수 있습니다.
#hostingforum.kr
php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL을 지정합니다.
$this->redirect('index/index');
}
}
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL과 매개변수를 지정합니다.
$this->redirect(array('controller' => 'index', 'action' => 'index'));
}
}
redirect 함수를 사용하여 페이지를 리다이렉트 시키는 방법에 대해 다음과 같이 설명할 수 있습니다.
#hostingforum.kr
php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL을 지정합니다.
$this->redirect('index/index');
}
}
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// 리다이렉트할 URL과 매개변수를 지정합니다.
$this->redirect(array('controller' => 'index', 'action' => 'index'));
}
}
2025-06-07 15:39