public function tree($id = null) {
		Configure::write('debug', 0);
		if (!method_exists($this->_model, 'getTreeData')) {
			throw new InternalErrorException(__d(
				'view_extension',
				'Method "%s" is not exists in model "%s"',
				'getTreeData()',
				$this->_model->name
			));
		}
		if (!$this->_controller->request->is('ajax') || !$this->_controller->request->is('post') ||
			!$this->_controller->RequestHandler->prefers('json')) {
			throw new BadRequestException();
		}

		$data = [
			[
				'text' => __d('view_extension', '&lt;None&gt;'),
			]
		];
		$treeData = $this->_model->getTreeData($id);
		if (!empty($treeData)) {
			$data = $treeData;
		}
		$this->_controller->set(compact('data'));
		$this->_controller->set('_serialize', 'data');
	}