# 自定義控制器中的構造函數？

My question: Is there some reason that I should call parent::__construct() inside of the constructor? It requires an argument, which looks like it should be an ID of some sort, but I'm not sure where I should get that.

## 最佳答案

/**
* Initializes the controller.  This method is called by the Craft before the controller starts to execute.
*
* @throws HttpException
* @return null
*/
public function init()
{

}