Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code generation: Custom controller templates

To start off, I'm using Asp.Net MVC 4, and I've modified my solution to contain the CodeTemplates folder by following this tutorial. (I think my issue might be MVC related?)

code_templates

I've replaced the code in the Ajax grid template with a with my own JQgrid-template, which was fine for getting my project started. But I'm having trouble creating completely new controller templates (well the having them show up in the create new controller menu)

add_controller_modal

any ideas?

Update

I've taken a few stabs at using the scaffolding feature, but it's not exactly what i had in mind (although it does work like expected. I watched a video by steve sanderson on the topic that was quite informative), any way to get my custom views/controllers inside the add controller gui?

like image 642
Rohan Büchner Avatar asked Jan 25 '12 06:01

Rohan Büchner


1 Answers

As far as my understanding of your problem goes, you cannot manage two controllers within one .ps1 file, which corresponds to your "AddController" directory. You have to use the Package Manager and issue a command like

Scaffold CustomScaffolder <choose-name>

This will generate another subfolder below CodeTemplates with the name . From there, you open and edit t4 files like you did with your existing one.

More info here

like image 121
StefG Avatar answered Oct 03 '22 15:10

StefG