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

Chapter 2. A URL Shortener

There are quite a few URL shorteners out there on the Internet; however, there's always room for a little fun and sometimes people or companies require their own solutions rather than just using an external provider. The project in this chapter covers just that—developing a URL shortener in CodeIgniter that can be used by anyone.

To make this app, we'll need to do a few things: we'll create two controllers, one to create a shortened URL and one to redirect a shortened URL to its actual location on the Web.

We'll create language files to store text, creating a foundation for multiple language support should you wish to implement it.

We will also make amends to the config/routes.php file—this is to ensure that the shortened URL is as short as it can be.

However, 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 may already have, bear in mind that the setup we did in Chapter 1, Introduction and Shared Project Resources, acts as a foundation for this chapter.

In this chapter, we will cover the following topics:

  • Design and wireframes
  • Creating the database
  • Adjusting the routes.php file
  • Creating the model
  • Creating the views
  • Creating the controllers
  • Putting it all together

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

主站蜘蛛池模板: 咸宁市| 鄂伦春自治旗| 滦南县| 西贡区| 蚌埠市| 巴南区| 丹凤县| 甘德县| 神池县| 昆山市| 安吉县| 石城县| 铅山县| 睢宁县| 五寨县| 望奎县| 潞城市| 阿图什市| 扶绥县| 云安县| 淮南市| 青铜峡市| 虎林市| 镇巴县| 北安市| 武宣县| 凌海市| 合山市| 英吉沙县| 莱阳市| 库车县| 即墨市| 从江县| 高阳县| 宁国市| 开平市| 绿春县| 陆川县| 扎鲁特旗| 同德县| 邹城市|