I have definitions as below:
\lstset{
commentstyle = \color{gray},
extendedchars = \true,
inputencoding = utf8x,
language = php,
keepspaces = true,
keywordstyle = \bfseries
}
And here's the code:
\begin{lstlisting}[language=PHP]
function processRequest()
{
$req = $this->request;
$view = $this->view;
$view->addHeaderScript("scripts/jquery_addons.js");
// doing smth...
return $this->view;
}
But only if
, else
and foreach
keywords are highlighted. I want function
and return
keywords also to be highlighted.
Best Answer
function
andreturn
seem not to be in the PHP keyword default list (which can be found in the filelstdrvrs
); you can add them usingmorekeywords
: