Upfront Custom Layout to PHP Template


I would like to know the following:

After making my custom layout in any page (using Upfront), how can i use this as a template? To be more exact, where is this template stored so I can go and do some further custom coding?

I have some php functions that I want to add in there (since my site is all about CPTs), I've made the layout I want in the front end.. now?