Customizing `mix phoenix.gen.*` tasks

Keep in mind though that Phoenix generators may use private APIs. So when you copy the source code, you may be depending on private APIs, implying the generator may break in future versions.

On the positive side, Phoenix allows you to customize templates without copying the generator. If you simply do step 2 and change the templates you copied, Phoenix will use the ones in your app rather than the ones it ships with:

 cp -r deps/phoenix/priv/templates/phoenix.gen.html priv/templates
 cp -r deps/phoenix/priv/templates/phoenix.gen.model priv/templates
4 Likes