Building a Blog System using Yii-1.1.10{Qiang Xue} (.pdf)-BIGMAP

seeders: 2
leechers: 0
Added on May 30, 2013 by BIGMAP101Zin Books
Torrent verified.



Building a Blog System using Yii-1.1.10{Qiang Xue} (.pdf)-BIGMAP (Size: 371.03 KB)
 Building a Blog System using Yii-1.1.10{Qiang Xue}.pdf371.03 KB

Description

Building a Blog System using Yii


BY


Qiang Xue


Contents
Contents i
License v
1 Getting Started 1
1.1 Building a Blog System using Yii . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Testdriving with Yii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2.1 Installing Yii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2.2 Creating Skeleton Application . . . . . . . . . . . . . . . . . . . . . . 2
1.2.3 Application Work
ow . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Requirements Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Overall Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Initial Prototyping 9
2.1 Setting Up Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1 Creating Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.2 Establishing Database Connection . . . . . . . . . . . . . . . . . . . 9
2.2 Scaolding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.1 Installing Gii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.2 Creating Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.3 Implementing CRUD Operations . . . . . . . . . . . . . . . . . . . . 13
2.2.4 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3 Authenticating User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3 Post Management 21
3.1 Customizing Post Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.1 Customizing rules() Method . . . . . . . . . . . . . . . . . . . . . . 21
3.1.2 Customizing relations() Method . . . . . . . . . . . . . . . . . . . 23
3.1.3 Adding url Property . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.1.4 Representing Status in Text . . . . . . . . . . . . . . . . . . . . . . . 25
3.2 Creating and Updating Posts . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.2.1 Customizing Access Control . . . . . . . . . . . . . . . . . . . . . . . 26
3.2.2 Customizing create and update Operations . . . . . . . . . . . . . . 27
3.3 Displaying Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.3.1 Customizing view Operation . . . . . . . . . . . . . . . . . . . . . . 29
3.3.2 Customizing index Operation . . . . . . . . . . . . . . . . . . . . . . 30
3.4 Managing Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.4.1 Listing Posts in Tabular View . . . . . . . . . . . . . . . . . . . . . . 32
3.4.2 Deleting Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4 Comment Management 35
4.1 Customizing Comment Model . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.1.1 Customizing rules() Method . . . . . . . . . . . . . . . . . . . . . . 35
4.1.2 Customizing attributeLabels() Method . . . . . . . . . . . . . . . . 35
4.1.3 Customizing Saving Process . . . . . . . . . . . . . . . . . . . . . . . 36
4.2 Creating and Displaying Comments . . . . . . . . . . . . . . . . . . . . . . . 36
4.2.1 Displaying Comments . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.2.2 Creating Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.2.3 Ajax-based Validation . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.3 Managing Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.3.1 Updating and Deleting Comments . . . . . . . . . . . . . . . . . . . 40
4.3.2 Approving Comments . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5 Portlets 43
5.1 Creating User Menu Portlet . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.1.1 Creating UserMenu Class . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.1.2 Creating userMenu View . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.1.3 Using UserMenu Portlet . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.1.4 Testing UserMenu Portlet . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.1.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2 Creating Tag Cloud Portlet . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2.1 Creating TagCloud Class . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2.2 Using TagCloud Portlet . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.3 Creating Recent Comments Portlet . . . . . . . . . . . . . . . . . . . . . . . 47
5.3.1 Creating RecentComments Class . . . . . . . . . . . . . . . . . . . . . 47
5.3.2 Creating recentComments View . . . . . . . . . . . . . . . . . . . . . 48
5.3.3 Using RecentComments Portlet . . . . . . . . . . . . . . . . . . . . . . 48
6 Final Work 49
6.1 Beautifying URLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.2 Logging Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.3 Final Tune-up and Deployment . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3.1 Changing Home Page . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3.2 Enabling Schema Caching . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3.3 Disabling Debugging Mode . . . . . . . . . . . . . . . . . . . . . . . 52
6.3.4 Deploying the Application . . . . . . . . . . . . . . . . . . . . . . . . 52
6.4 Future Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.4.1 Using a Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.4.2 Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.4.3 Improving Performance with Cache . . . . . . . . . . . . . . . . . . . 53
6.4.4 Adding New Features . . . . . . . . . . . . . . . . . . . . . . . . . . 54

Sharing Widget


Download torrent
371.03 KB
seeders:2
leechers:0
Building a Blog System using Yii-1.1.10{Qiang Xue} (.pdf)-BIGMAP