Woah there, hold on a second..
It is great that you've identified the code you've written could be improved, but improvement doesn't just mean "moving everything from one place to another".
What you have the chance to do is to rethink how you've done things, and move into a "more structured" (in my opinion..) way of working.
Assuming you have successfully got Phalcon setup, I'd suggest reading through the first tutorial. This really is a great resource.
The MVC architecture is something a lot of sites run with nowadays, and if you aren't familiar with it, this link might help you out.
It is difficult to provide a direct answer to your question, as I think after a bit of reading everything will become clearer.
In your case, it sounds like it might be good to have this Smarty class as a service, that can be registered with Phalcon that can then be dependency injected.
Have a go/read, and let me/us know how it goes for you.