<pre><code>$view-&gt;hook('cp.entries.edit.details', functionThatReturnsView())
</code></pre>

<p>Is the correct way in Craft 3.</p>

CC BY-SA 4.0
2018-12-15T02:21:10.613Z
2018-12-15T02:21:10.613Z
Chattervast
<p>I'm looking to add a custom fields to the <code>details</code> section on the right of the entry edit view in the control panel.</p>

<p>I know that in Craft 2 this was possible using:
<code>Craft::$app-&gt;view-&gt;hook('cp.entries.edit.details', functionThatReturnsView())</code></p>

<p>Is there a more Craft 3 way to do this or do we still use the Craft 2 API for this kind of extension to control panel?</p>

CC BY-SA 4.0
2018-12-11T13:07:33.813Z
Have you tried $view->hook('cp.entries.edit.details', functionThatReturnsView())
Chattervast
CC BY-SA 4.0
2018-12-11T17:31:28.700Z
Yep, and it works. But it seems strange that it would be done that way, would have expected it to follow the Craft 3 way of doing things.
Piaras Hoban
CC BY-SA 4.0
2018-12-15T01:41:51.197Z
Want to add that as an official answer, @IndigoViking?
Brad Bell
<plugin-development><craft3>
Added custom entry details fields
# Added custom entry details fields

(Asked by: username_0 on 2018-12-11)

I'm looking to add a custom fields to the `details` section on the right of the entry edit view in the control panel.

I know that in Craft 2 this was possible using:
`Craft::$app->view->hook('cp.entries.edit.details', functionThatReturnsView())`

Is there a more Craft 3 way to do this or do we still use the Craft 2 API for this kind of extension to control panel?

**Tags:** plugin-development, craft3

> **Comments:**
> **username_1**: Have you tried $view->hook('cp.entries.edit.details', functionThatReturnsView())  
> **username_0**: Yep, and it works. But it seems strange that it would be done that way, would have expected it to follow the Craft 3 way of doing things.  
> **username_2**: Want to add that as an official answer, @IndigoViking?  

---

## 1 answers

### Answer by username_1 on 2018-12-15. Score: 2 | Accepted answer

$view->hook('cp.entries.edit.details', functionThatReturnsView())

Is the correct way in Craft 3.


---

