public function delete($slug)
    {
        $this->loadModel('Content.ContentTypes');
        $type = $this->ContentTypes->find()
            ->where(['slug' => $slug])
            ->first();

        if (!$type) {
            throw new NotFoundException(__d('content', 'Content type was not found!'));
        }

        if ($this->ContentTypes->delete($type)) {
            $this->Flash->success(__d('content', 'Content was deleted!'));
        } else {
            $$this->Flash->danger(__d('content', 'Content type could not be deleted, please try again.'));
        }

        $this->title(__d('content', 'Delete Content Type'));
        $this->redirect($this->referer());
    }