I've wrote this, and it works:
(use-package web-mode :ensure t :mode (("\\.php$" . web-mode) ("\\.html$" . web-mode)) :preface (defun dg/web-mode-hook()) :config (add-hook 'web-mode-hook 'dg/web-mode-hook))
web-mode when opening .php or .html files.
I've noticed that
use-package also provides
:hook directive, but it's not very clear how I can use it in this case.
Thanks in advance.