We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Zephir : How can i use phalcon in Zephir

Can I extend a class in Zephir from a phalcon class (e.g. \Phalcon\Mvc\Model)? If so, is there any sample code? Thanks.

For the purposes of extending, you can imagine a Phalcon class is just like any other class - it can be extended. Any of the tutorials should have example code. The documentation on models also shows how, when you create your own model, you're extending the \Phalcon\Mvc\Model class.

If I understand the original question correctly, I have the same question. I am writing multiple libraries in zephir, but would like to #include <ext/phalcon/phalcon.h> so that I can use some phalcon components in my library. For example, re-using cache, annotations and DI would be great.

I'm stuck being unable to continue on a couple of ideas just because I cant figure out how to include the phalcon annotations. I tried to copy/paste the zep files into my library and rename namespace, but then it requires some optimizations and c files and I have no clue how to make those work.

Would be nice to have some kind of: import Phalcon