Fix Gii template around issue #3760 (@qiangxue case)