官术网_书友最值得收藏!

Chapter 3. Discussion Forum

A discussion forum can be quite a useful resource to have on internal company projects or to allow clients to interact on projects, for example.

Discussion forums are a great way to create a community around a particular subject or topic, acting as a type of wiki. They are a store of knowledge of something or a record of a discussion, containing a history of changes of ideas and concepts and recording the evolution of thinking around a topic or subject. They can also be used to talk about cats.

To create this app, we'll create three controllers: one to handle discussions, one to handle comments, and one to handle any admin functionality that we might need, such as moderating comments and discussions.

We'll create a language file to store text, allowing you to have multiple language support, should that be required.

We will make amendments to the config.php file to allow for encryption support, which is necessary for sessions and password support.

We'll create all the necessary view files and even a .css file to help Bootstrap with some of the views.

This app, along with all the others in this book, relies on the basic setup we did in Chapter 1, Introduction and Shared Project Resources, although you can take large sections of the code and drop it into pretty much any app you might already have; please keep in mind that the setup done in the first chapter acts as the foundation for this chapter.

It is worth mentioning the limits of the application. This application contains the most basic discussion forum functionality. We create users on our way; however, there is no user management—to include that would be a large extension of the application code and slightly out of scope of a discussion forum.

Users are created when someone creates a comment or discussion using an e-mail address that is not currently stored in the users table. A password is generated for them and a hash is created based on that password.

As this application creates a password for them automatically, you might wish to tell them what that password is—perhaps by sending them an e-mail. However, you might not wish them to be able to log in at all. It's up to you—the functionality is there should you wish to expand upon it.

In this chapter, we will cover:

  • Design and wireframes
  • Creating the database
  • Creating the models
  • Creating the views
  • Creating the controllers
  • Putting it all together

So, without further ado, let's get on with it.

主站蜘蛛池模板: 岢岚县| 蒲江县| 兴隆县| 宁德市| 湾仔区| 文安县| 襄垣县| 荣成市| 鄄城县| 陈巴尔虎旗| 公安县| 衡东县| 繁昌县| 元朗区| 个旧市| 奉节县| 沁水县| 绥中县| 沙河市| 略阳县| 蕉岭县| 巴马| 龙川县| 五寨县| 阿克陶县| 田阳县| 宝山区| 昂仁县| 若羌县| 营口市| 湄潭县| 若尔盖县| 锡林郭勒盟| 瑞金市| 广宁县| 南平市| 东兴市| 永年县| 蛟河市| 赣榆县| 凤冈县|