Answer the question
In order to leave comments, you need to log in
How to display headers, content (string) in a component and correctly terminate the application?
1. How to display headers, content (string) in a component and correctly terminate the application?
2. How about a redirect?
The component is used as BeforeController (i.e. it is registered in the config in the bootstrap parameter and in the init of the component we already write what needs to be done before calling the controller). Depending on the requested domain name, you need to take certain actions and not launch the main site.
Answer the question
In order to leave comments, you need to log in
Why not?
class Controller extends MainController {
public function beforeAction($action)
{
if (!parent::beforeAction($action)) {
return false;
}
if (!isset($_GET['user'])){
return $this->redirect('index');
}
return true;
}}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question