In this paper we describe \textsc{PDELab}, an extensible C++ template library for finite element methods based on the Distributed and Unified Numerics Environment (\textsc{Dune}). \textsc{PDELab} considerably simplifies the implementation of discretization schemes for systems of partial differential equations by setting up global functions and operators from a simple element-local description. A general concept for incorporation of constraints eases the implementation of essential boundary conditions, hanging nodes and varying polynomial degree. The underlying \textsc{Dune} software framework provides parallelization and dimension-independence.