In this chapter, you learned how to create various types of Yii extensions. Now we'll talk about how to share your results with people and why it's important.
Let's form a checklist for a good extension first. A good programming product should follow these points:
Of course, having all these requires a lot of work, but these are necessary to create a good product.
isFlag1()
and isNotFlag2()
, and so on. Everything should obey the rules you've defined for your code. This allows less checking of documentation and allows you to focus on coding.If you want to share an extension with the community and be sure it will be useful and popular, you need to do more than just write code. Making extensions distribution-ready is much more work to do. It can be even more than creating an extension itself. So, why is it good to share extensions with the community in the first place?
Making the code you use in your own projects open source has its pros. You are getting people, a lot more people than you can get to test your closed source project. People who are using your extension are testing it, giving valuable feedback, and reporting bugs. If your code is popular, there will be passionate developers who will try to improve your code, to make it more extensive, more stable, and reusable. Moreover, it just feels good because you are doing a good thing.
We have covered the most important things. Still, there are more things to check out. Try existing extensions before writing your own. If an extension almost fits, try contacting the extension author and contributing ideas you have. Reviewing existing code helps you find out useful tricks, dos, and don'ts. Also, check wiki articles and the official forum from time to time; there is a lot of useful information about creating extensions and developing using Yii in general.
3.145.111.125