Your SlideShare is downloading. ×
Web Application Development using MVC Framework Kohana
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Web Application Development using MVC Framework Kohana

5,696
views

Published on

I tried to show key features of Kohana (KO3) and CRUD using Kohana.

I tried to show key features of Kohana (KO3) and CRUD using Kohana.

Published in: Technology

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,696
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
153
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Web Application Development using MVC Framework Kohana Arafat Rahman Web Application Developer Solution Arena http://arafatbd.net
  • 2. Framework ? Provides  Generic functionality  Some key features  Reusable  Well-defined  Specialized by user
  • 3. Why Kohana (KO3)  Its MVC  Its HMVC  Very fast framework  Strict PHP 5.2 - OOP and extremely DRY  Many common components  Simple routing structure
  • 4. MVC ? Model-View-Controller
  • 5. MVC
  • 6. HMVC ? Hierarchical Model View Controller
  • 7. MVC and HMVC
  • 8. Setting up Kohana (KO3)
  • 9. Setting up Kohana
  • 10. Configuration application/bootstrap.php Kohana::init(array( 'base_url' => '/kohana/', ));
  • 11. Configuration (cont.) Delete  /install.php
  • 12. Requesting a Controller /index.php/<controller>/<action> example: /index.php/topic/view/123
  • 13. Hello, world!
  • 14. Hello, world! (cont.) http://localhost/kohana/index.php/welcome
  • 15. Hide index.php How to hide index.php http://kerkness.ca/wiki/doku.php? id=removing_the_index.php
  • 16. Hello, world! (cont.) http://localhost/kohana/welcome
  • 17. Database Config application/bootstrap.php
  • 18. Database Config (cont.) application/config/database.php
  • 19. Database Config (cont.) application/config/database.php
  • 20. Create Table: topics CREATE TABLE `kohana`.`topics` ( `topic_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `title` VARCHAR( 250 ) NOT NULL , `description` TEXT NOT NULL , `date` DATETIME NOT NULL ) ;
  • 21. Reading Database Records application/classes/controller/topic.php
  • 22. Reading Database Records application/classes/controller/topic.php try { $data['topics'] = DB::select() ->from('topics') ->order_by('date', "DESC") ->execute() ->as_array(); $this->request->response = View::factory('list', $data); }
  • 23. Reading Database Records application/view/list.php
  • 24. Reading Database Records application/view/list.php
  • 25. Reading Database Records application/view/list.php
  • 26. Inserting New Records application/classes/controller/topic.php http://localhost/kohana/topic/new_topic
  • 27. Inserting New Records (cont.) http://localhost/kohana/topic/new_topic
  • 28. Inserting New Records (cont.) application/classes/controller/topic.php
  • 29. Inserting New Records (cont.) application/classes/controller/topic.php
  • 30. Inserting New Records (cont.) application/classes/controller/topic.php
  • 31. Update Records http://localhost/kohana/topic/index
  • 32. Update Records (cont.) application/classes/controller/topic.php
  • 33. Update Records (cont.) application/classes/controller/topic.php
  • 34. Update Records (cont.) http://localhost/kohana/topic/edit/1
  • 35. Update Records (cont.) application/classes/controller/topic.php
  • 36. Update Records (cont.) application/classes/controller/topic.php
  • 37. Model and ORM Object Relational Mapping (ORM) application/classes/model/topic.php class Model_Topic extends ORM { ... }
  • 38. HMVC In a View <?php echo $content;?><br/> <?php echo Request::factory('topic/featured') ->execute()->response; ?>
  • 39. HMVC (cont.) In a Controller $data['featured'] = Request::factory('topic/featured') ->execute()->response;
  • 40. References  Kohana Documentation http://kohanaframework.org/documentation  Unofficial documentaion http://kerkness.ca/wiki/doku.php
  • 41. Questions ? Again, I am Arafat Rahman http://arafatbd.net