SlideShare una empresa de Scribd logo
1 de 41
Web Application Development
using MVC Framework Kohana




                Arafat Rahman
            Web Application Developer
                       Solution Arena
                http://arafatbd.net
Framework ?
Provides

    Generic
    functionality

    Some key features

    Reusable

    Well-defined

    Specialized by user
Why Kohana (KO3)

    Its MVC

    Its HMVC

    Very fast framework

    Strict PHP 5.2 - OOP and extremely DRY

    Many common components

    Simple routing structure
MVC ?

Model-View-Controller
MVC
HMVC ?

Hierarchical Model View Controller
MVC and HMVC
Setting up Kohana (KO3)
Setting up Kohana
Configuration
application/bootstrap.php


Kohana::init(array(
'base_url'       => '/kohana/',
));
Configuration (cont.)
Delete

    /install.php
Requesting a Controller

/index.php/<controller>/<action>

example:
/index.php/topic/view/123
Hello, world!
Hello, world! (cont.)
http://localhost/kohana/index.php/welcome
Hide index.php
How to hide index.php


http://kerkness.ca/wiki/doku.php?
  id=removing_the_index.php
Hello, world! (cont.)
http://localhost/kohana/welcome
Database Config
application/bootstrap.php
Database Config (cont.)
application/config/database.php
Database Config (cont.)
application/config/database.php
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
) ;
Reading Database Records
application/classes/controller/topic.php
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);
}
Reading Database Records
application/view/list.php
Reading Database Records
application/view/list.php
Reading Database Records
application/view/list.php
Inserting New Records
application/classes/controller/topic.php




http://localhost/kohana/topic/new_topic
Inserting New Records (cont.)
http://localhost/kohana/topic/new_topic
Inserting New Records (cont.)
application/classes/controller/topic.php
Inserting New Records (cont.)
application/classes/controller/topic.php
Inserting New Records (cont.)
application/classes/controller/topic.php
Update Records
http://localhost/kohana/topic/index
Update Records (cont.)
application/classes/controller/topic.php
Update Records (cont.)
application/classes/controller/topic.php
Update Records (cont.)
http://localhost/kohana/topic/edit/1
Update Records (cont.)
application/classes/controller/topic.php
Update Records (cont.)
application/classes/controller/topic.php
Model and ORM
        Object Relational Mapping (ORM)

application/classes/model/topic.php

class Model_Topic extends ORM {
     ...
}
HMVC
In a View
<?php echo $content;?><br/>
<?php echo
 Request::factory('topic/featured')
  ->execute()->response;
?>
HMVC (cont.)
In a Controller
$data['featured'] =
 Request::factory('topic/featured')
  ->execute()->response;
References

    Kohana Documentation
http://kohanaframework.org/documentation

    Unofficial documentaion
http://kerkness.ca/wiki/doku.php
Questions ?
Again, I am

Arafat Rahman
http://arafatbd.net

Más contenido relacionado

La actualidad más candente

Tomcat Configuration (1)
Tomcat Configuration (1)Tomcat Configuration (1)
Tomcat Configuration (1)nazeer pasha
 
Oracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single nodeOracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single nodeOsama Mustafa
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)than sare
 
Oracle olap-installation
Oracle olap-installationOracle olap-installation
Oracle olap-installationAmit Sharma
 
Apache Tomcat 8 Application Server
Apache Tomcat 8 Application ServerApache Tomcat 8 Application Server
Apache Tomcat 8 Application Servermohamedmoharam
 
Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuninglovingprince58
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data WeaveMohammed246
 
MuleSoft ESB Object Store
MuleSoft ESB Object StoreMuleSoft ESB Object Store
MuleSoft ESB Object Storeakashdprajapati
 
Knowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletKnowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletFahmi Jafar
 

La actualidad más candente (19)

Tomcat Configuration (1)
Tomcat Configuration (1)Tomcat Configuration (1)
Tomcat Configuration (1)
 
Tomcat
TomcatTomcat
Tomcat
 
REST API Laravel
REST API LaravelREST API Laravel
REST API Laravel
 
Passing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flowPassing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flow
 
Oracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single nodeOracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single node
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)
 
Oracle olap-installation
Oracle olap-installationOracle olap-installation
Oracle olap-installation
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Auxiliary : Tomcat
Auxiliary : TomcatAuxiliary : Tomcat
Auxiliary : Tomcat
 
Apache Tomcat 8 Application Server
Apache Tomcat 8 Application ServerApache Tomcat 8 Application Server
Apache Tomcat 8 Application Server
 
Cake php
Cake phpCake php
Cake php
 
Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuning
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
 
RoR guide_p1
RoR guide_p1RoR guide_p1
RoR guide_p1
 
Lect06 tomcat1
Lect06 tomcat1Lect06 tomcat1
Lect06 tomcat1
 
5-WebServers.ppt
5-WebServers.ppt5-WebServers.ppt
5-WebServers.ppt
 
MuleSoft ESB Object Store
MuleSoft ESB Object StoreMuleSoft ESB Object Store
MuleSoft ESB Object Store
 
Knowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletKnowledge Sharing : Java Servlet
Knowledge Sharing : Java Servlet
 
Servlets
ServletsServlets
Servlets
 

Destacado

Prototyping for tiny fingers
Prototyping for tiny fingersPrototyping for tiny fingers
Prototyping for tiny fingersJulio Pari
 
Rettig onprototyping
Rettig onprototypingRettig onprototyping
Rettig onprototypingJulio Pari
 
Algoritmica i clase03 practica 3 solucionario
Algoritmica i clase03 practica 3 solucionarioAlgoritmica i clase03 practica 3 solucionario
Algoritmica i clase03 practica 3 solucionarioJulio Pari
 
Spredfast pocketguide-final
Spredfast pocketguide-finalSpredfast pocketguide-final
Spredfast pocketguide-finalJulio Pari
 
Algoritmica i clase06 ejercicio apuntadores
Algoritmica i clase06 ejercicio apuntadoresAlgoritmica i clase06 ejercicio apuntadores
Algoritmica i clase06 ejercicio apuntadoresJulio Pari
 
Kohana bootstrap - modal form
Kohana   bootstrap - modal formKohana   bootstrap - modal form
Kohana bootstrap - modal formJulio Pari
 
Amazon dynamo-sosp2007
Amazon dynamo-sosp2007Amazon dynamo-sosp2007
Amazon dynamo-sosp2007Julio Pari
 
Jdeveloper 11g
Jdeveloper 11gJdeveloper 11g
Jdeveloper 11gJulio Pari
 

Destacado (8)

Prototyping for tiny fingers
Prototyping for tiny fingersPrototyping for tiny fingers
Prototyping for tiny fingers
 
Rettig onprototyping
Rettig onprototypingRettig onprototyping
Rettig onprototyping
 
Algoritmica i clase03 practica 3 solucionario
Algoritmica i clase03 practica 3 solucionarioAlgoritmica i clase03 practica 3 solucionario
Algoritmica i clase03 practica 3 solucionario
 
Spredfast pocketguide-final
Spredfast pocketguide-finalSpredfast pocketguide-final
Spredfast pocketguide-final
 
Algoritmica i clase06 ejercicio apuntadores
Algoritmica i clase06 ejercicio apuntadoresAlgoritmica i clase06 ejercicio apuntadores
Algoritmica i clase06 ejercicio apuntadores
 
Kohana bootstrap - modal form
Kohana   bootstrap - modal formKohana   bootstrap - modal form
Kohana bootstrap - modal form
 
Amazon dynamo-sosp2007
Amazon dynamo-sosp2007Amazon dynamo-sosp2007
Amazon dynamo-sosp2007
 
Jdeveloper 11g
Jdeveloper 11gJdeveloper 11g
Jdeveloper 11g
 

Similar a 003 web-apps-using-kohana-arafat-rahman-101107191139-phpapp02

Web Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaWeb Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaArafat Rahman
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's CodeWildan Maulana
 
Rapid Development With CakePHP
Rapid Development With CakePHPRapid Development With CakePHP
Rapid Development With CakePHPEdureka!
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code IgniterAmzad Hossain
 
Building Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHPBuilding Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHPEdureka!
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughBradley Holt
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4than sare
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
PHP 7 - A look at the future
PHP 7 - A look at the futurePHP 7 - A look at the future
PHP 7 - A look at the futureRadu Murzea
 
PHP7 - A look at the future
PHP7 - A look at the futurePHP7 - A look at the future
PHP7 - A look at the futureRadu Murzea
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Hugo Hamon
 
ASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache ExtensibilityASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache Extensibilityakrakovetsky
 

Similar a 003 web-apps-using-kohana-arafat-rahman-101107191139-phpapp02 (20)

Web Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaWeb Application Development using MVC Framework Kohana
Web Application Development using MVC Framework Kohana
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
Intro to Laravel 4
Intro to Laravel 4Intro to Laravel 4
Intro to Laravel 4
 
Codegnitorppt
CodegnitorpptCodegnitorppt
Codegnitorppt
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's Code
 
Refreshing mule cache using oracle database change notification
Refreshing mule cache using oracle database change notificationRefreshing mule cache using oracle database change notification
Refreshing mule cache using oracle database change notification
 
Rapid Development With CakePHP
Rapid Development With CakePHPRapid Development With CakePHP
Rapid Development With CakePHP
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
Building Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHPBuilding Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHP
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start Walkthrough
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
PHP 7 - A look at the future
PHP 7 - A look at the futurePHP 7 - A look at the future
PHP 7 - A look at the future
 
PHP7 - A look at the future
PHP7 - A look at the futurePHP7 - A look at the future
PHP7 - A look at the future
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
ASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache ExtensibilityASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache Extensibility
 

Más de Julio Pari

Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes #Ibm virtual la...
Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes #Ibm virtual la...Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes #Ibm virtual la...
Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes #Ibm virtual la...Julio Pari
 
Links kubernetes - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Links kubernetes - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesLinks kubernetes - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Links kubernetes - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesJulio Pari
 
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesComandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesJulio Pari
 
Indice General Tesis Sistemas UPC
Indice General Tesis Sistemas UPCIndice General Tesis Sistemas UPC
Indice General Tesis Sistemas UPCJulio Pari
 
Arquitectura Web FISI UNMSM
Arquitectura Web FISI UNMSMArquitectura Web FISI UNMSM
Arquitectura Web FISI UNMSMJulio Pari
 
Jelastic Enterprise
Jelastic EnterpriseJelastic Enterprise
Jelastic EnterpriseJulio Pari
 
Marketing Examen Parcial Profesor Osorio
Marketing Examen Parcial Profesor OsorioMarketing Examen Parcial Profesor Osorio
Marketing Examen Parcial Profesor OsorioJulio Pari
 
Ingenieria Software Examen Parcial 2013 2 Profesor Cordero
Ingenieria Software Examen Parcial 2013 2 Profesor CorderoIngenieria Software Examen Parcial 2013 2 Profesor Cordero
Ingenieria Software Examen Parcial 2013 2 Profesor CorderoJulio Pari
 
Documento de Arquitectura
Documento de ArquitecturaDocumento de Arquitectura
Documento de ArquitecturaJulio Pari
 
Solucion Examen Parcial Sistemas Digitales UNMSM FISI
Solucion Examen Parcial Sistemas Digitales UNMSM FISISolucion Examen Parcial Sistemas Digitales UNMSM FISI
Solucion Examen Parcial Sistemas Digitales UNMSM FISIJulio Pari
 
Práctica de Inventarios - Investigación Operativa II
Práctica de Inventarios - Investigación Operativa IIPráctica de Inventarios - Investigación Operativa II
Práctica de Inventarios - Investigación Operativa IIJulio Pari
 
Armas silenciosas para guerras tranquilas
Armas silenciosas para guerras tranquilasArmas silenciosas para guerras tranquilas
Armas silenciosas para guerras tranquilasJulio Pari
 
Formato de presentación de Proyecto UNMSM FISI
Formato de presentación de Proyecto UNMSM FISIFormato de presentación de Proyecto UNMSM FISI
Formato de presentación de Proyecto UNMSM FISIJulio Pari
 
Cuento para nuestro hijo y nuestra hija
Cuento para nuestro hijo y nuestra hijaCuento para nuestro hijo y nuestra hija
Cuento para nuestro hijo y nuestra hijaJulio Pari
 
Ingeniería de Software Examen Parcial
Ingeniería de Software Examen ParcialIngeniería de Software Examen Parcial
Ingeniería de Software Examen ParcialJulio Pari
 
Sistemas Distribuidos Examen Parcial
Sistemas Distribuidos Examen ParcialSistemas Distribuidos Examen Parcial
Sistemas Distribuidos Examen ParcialJulio Pari
 
Php07 consultas bd
Php07 consultas bdPhp07 consultas bd
Php07 consultas bdJulio Pari
 
Php06 instalacion my_sql
Php06 instalacion my_sqlPhp06 instalacion my_sql
Php06 instalacion my_sqlJulio Pari
 
Php05 funciones usuario
Php05 funciones usuarioPhp05 funciones usuario
Php05 funciones usuarioJulio Pari
 

Más de Julio Pari (20)

Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes #Ibm virtual la...
Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes #Ibm virtual la...Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes #Ibm virtual la...
Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes #Ibm virtual la...
 
Links kubernetes - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Links kubernetes - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesLinks kubernetes - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Links kubernetes - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
 
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesComandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
 
Indice General Tesis Sistemas UPC
Indice General Tesis Sistemas UPCIndice General Tesis Sistemas UPC
Indice General Tesis Sistemas UPC
 
Arquitectura Web FISI UNMSM
Arquitectura Web FISI UNMSMArquitectura Web FISI UNMSM
Arquitectura Web FISI UNMSM
 
Jelastic Enterprise
Jelastic EnterpriseJelastic Enterprise
Jelastic Enterprise
 
Marketing Examen Parcial Profesor Osorio
Marketing Examen Parcial Profesor OsorioMarketing Examen Parcial Profesor Osorio
Marketing Examen Parcial Profesor Osorio
 
Ingenieria Software Examen Parcial 2013 2 Profesor Cordero
Ingenieria Software Examen Parcial 2013 2 Profesor CorderoIngenieria Software Examen Parcial 2013 2 Profesor Cordero
Ingenieria Software Examen Parcial 2013 2 Profesor Cordero
 
Documento de Arquitectura
Documento de ArquitecturaDocumento de Arquitectura
Documento de Arquitectura
 
Solucion Examen Parcial Sistemas Digitales UNMSM FISI
Solucion Examen Parcial Sistemas Digitales UNMSM FISISolucion Examen Parcial Sistemas Digitales UNMSM FISI
Solucion Examen Parcial Sistemas Digitales UNMSM FISI
 
Práctica de Inventarios - Investigación Operativa II
Práctica de Inventarios - Investigación Operativa IIPráctica de Inventarios - Investigación Operativa II
Práctica de Inventarios - Investigación Operativa II
 
Armas silenciosas para guerras tranquilas
Armas silenciosas para guerras tranquilasArmas silenciosas para guerras tranquilas
Armas silenciosas para guerras tranquilas
 
UML Java
UML JavaUML Java
UML Java
 
Formato de presentación de Proyecto UNMSM FISI
Formato de presentación de Proyecto UNMSM FISIFormato de presentación de Proyecto UNMSM FISI
Formato de presentación de Proyecto UNMSM FISI
 
Cuento para nuestro hijo y nuestra hija
Cuento para nuestro hijo y nuestra hijaCuento para nuestro hijo y nuestra hija
Cuento para nuestro hijo y nuestra hija
 
Ingeniería de Software Examen Parcial
Ingeniería de Software Examen ParcialIngeniería de Software Examen Parcial
Ingeniería de Software Examen Parcial
 
Sistemas Distribuidos Examen Parcial
Sistemas Distribuidos Examen ParcialSistemas Distribuidos Examen Parcial
Sistemas Distribuidos Examen Parcial
 
Php07 consultas bd
Php07 consultas bdPhp07 consultas bd
Php07 consultas bd
 
Php06 instalacion my_sql
Php06 instalacion my_sqlPhp06 instalacion my_sql
Php06 instalacion my_sql
 
Php05 funciones usuario
Php05 funciones usuarioPhp05 funciones usuario
Php05 funciones usuario
 

003 web-apps-using-kohana-arafat-rahman-101107191139-phpapp02