Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Like this? Share it with your network

Share

Web Application Development using MVC Framework Kohana

  • 6,339 views
Uploaded 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.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
6,339
On Slideshare
6,307
From Embeds
32
Number of Embeds
2

Actions

Shares
Downloads
148
Comments
0
Likes
4

Embeds 32

http://speakerrate.com 31
http://translate.googleusercontent.com 1

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', &quot;DESC&quot;)
    • ->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