generate controller register and template index