Chris Pollett > Students >
Swathi

    ( Print View )

    [Bio]

    [Project Blog]

    [CS297 Proposal]

    [Cakephp Tutorial[PDF]]

    [Deliverable 1:CakePHP]

    [Deliverable 2:JavaScript Frameworks]

    [Deliverable 3: Drag and drops]

    [Deliverable 4: Layout of the IDE]

    [CS297 Report [PDF]]

    [CS298 Proposal]

    [CS298 Report [PDF]]

    [CS298 Presentation [PDF]]

    [CS298 Code]

                          

























Experiments with cakePHP

1.Motivation

The main objective of this deliverable was to experiment with PHP and CakePHP. CakePHP is a rapid development framework for PHP and provides an extensible architecture for developing, maintaining, and deploying Web applications. CakePHP uses a MVC platform within the convention over configuration paradigm. This helps the developers write less code [1]. As the complete IDE needs to build on this framework, this deliverable scope was extended to create a web application.

2.Goal

The goal of developing the Book Collection website was to get to know the database operations and handle the data from different models. This website is where users can register to the website and login into their accounts to view the book collection available and add books to their cart for reservation.

3.Implementation

The website consists of the Home page, Registration page, Login page, Book collection page and Cart Page. The software needed to develop the application is WAMP (Windows Apache HTTP Server PHP MySQL Database) and CakePHP. The Home page of the website is the one where new users can enter into the Registration page and the returning users can go to the Login page.

The Registration page contains a form where a user has to enter the user id, password and first name to register onto the website. Once he clicks on the register button, the user is taken to the Login page.

The Login page is the place where the user is autheticated to view the book collection. It contains a form where the user is asked to enter his username and password. Once the user clicks on the login button entering the correct credentials he is taken to the Book collection page. The book collection page shown in Fig.1, is the place where users can view the entire collection of books. The user can add any number of books to his cart, requesting for the reservation of the book. The right user can also add a book to the collection by clicking on the Add book link. Similarly, the same user can also edit the book details in the collection by clicking on the Edit link.

All the users can add the books to their carts by clicking on the link Add to cart and also view the book in the carts by clicking the link Go to cart. The user can then finally logout from the website by clicking on the link logout.

All the users can add the books to their carts by clicking on the link Add to cart and also view the book in the carts by clicking the link Go to cart. The user can then finally logout from the website by clicking on the link Logout.

To build this web application the following tasks were accomplished.
1. Installed WAMP 2.0i, which includes Apache2.2.11, MySQL5.1.36 and PHP5.3.0
2. Downloaded CakePHP 1.3.0
3. Added cakephp folder to the WWW folder of WAMP.
4. Configured the database settings in the /app/config/database.php file.
5. Created three tables in the database namely users, books and book_carts (according to the naming conventions to be followed in CakePHP).
6. Created the associated model.php files in cakephp\app\models\
7. Created the associated controller.php files in cakephp\app\controllers\
8. Created the .ctp files in the associated view folders under cakephp\app\views\

4.Remarks

The website developed helped in gaining experience on how to work in the MVC framework and I found CakePHP to be a well organized framework where in each file is put into its corresponding folder like models, views and controllers which makes both the developing and maintaining the web applications easy. Also gained knowledge in how to handle the model objects in the controllers and build the view components.

5.Code

The source code can be found here[ZIP].