Chapter 8: Laravel Route View. Asst.Prof.Dr. Supakit Nootyaskool Information Technology, KMITL

Similar documents
Developing ASP.NET MVC 4 Web Applications MOC 20486

Developing ASP.NET MVC 4 Web Applications

Developing ASP.NET MVC 4 Web Applications Course 20486A; 5 Days, Instructor-led

Elgg 1.8 Social Networking

Chapter 1 Introduction to web development and PHP

Agenda. 1. ZAPms Konzept. 2. Benutzer-Kontroller. 3. Laout-Aufbau. 4. Template-Aufbau. 6. Konfiguration. 7. Module.

Developer Tutorial Version 1. 0 February 2015

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

Modern Web Application Framework Python, SQL Alchemy, Jinja2 & Flask

Secure Testing Service

How to Customize Support Portals

Web Development Frameworks. Matthias Korn

MODx Web Development. Antano Solar John. Chapter No. 5 "Authentication and Authorization"

Joomla 1.0 Extension Development Training. Learning to program for Joomla

<link rel="stylesheet" type="text/css" media="all" href="css/iphone.css" /> <!-- User defined styles -->

Rich User Interfaces for Web-Based Corporate Applications

ShoreTel Enterprise Contact Center 8 Installing and Implementing Chat

Symfony 2 Tutorial. Model. Neues Bundle erstellen: php app/console generate:bundle --namespace=blogger/blogbundle

Chapter 1. Introduction to web development

Differences between HTML and HTML 5

Chris van Daele / / QuestBack, Köln. Laravel 5 Framework. The PHP Framework for Web Artisans

Support Notes (Issue 1) September IGphones. Certificate in Digital Applications (DA105) Coding for the Web

Evaluation. Chapter 1: An Overview Of Ruby Rails. Copy. 6) Static Pages Within a Rails Application

Ruby On Rails. CSCI 5449 Submitted by: Bhaskar Vaish

PHP Debugging. Draft: March 19, Christopher Vickery

MAGENTO QUICK START. Magento users New and relatively new Mostly on Community Ed. > 1 year; 16% Not at all yet; 33% 3 mo.

Getting Started with AWS. Hosting a Static Website

Responsive Design Best Practices

Portals and Hosted Files

ClickDimensions Quick Start Guide For Microsoft Dynamics CRM /1/2011 ClickDimensions

Developing Microsoft SharePoint Server 2013 Advanced Solutions. Version: Demo. Page <<1/8>>

HTML Fails: What No One Tells You About HTML

.NET Best Practices Part 1 Master Pages Setup. Version 2.0

Building A Very Simple Website

THE OPEN UNIVERSITY OF TANZANIA

CLASSROOM WEB DESIGNING COURSE

BUILDING MOBILE WEB APPS WITH PHONEGAP. Matt Zukowski

Transition your MCPD Web Developer Skills to MCPD ASP.NET Developer 3.5 (VB)

Google Web Toolkit. Progetto di Applicazioni Software a.a. 2011/12. Massimo Mecella

J j enterpririse. Oracle Application Express 3. Develop Native Oracle database-centric web applications quickly and easily with Oracle APEX

CrownPeak Playbook CrownPeak Hosting with PHP

Content Management System

Introduction to Websites & Dynamic Content

Installing and Using Joomla Template Created with Artisteer

Drupal CMS for marketing sites

Creating a generic user-password application profile

FileMaker Server 10 Help

Technical Specifications (Excerpt) TrendInfoWorld Web Site

Gantry Basics. Presented By: Jesse Hammil (Peanut Gallery: David Beuving)

CONFIGURING A WEB SERVER AND TESTING WEBSPEED

Pentesting Web Frameworks (preview of next year's SEC642 update)

Project Plan Log Monitoring Compliance

<Insert Picture Here>

Website Development Komodo Editor and HTML Intro

SEO Suite Pro. User Guide

Magento 1.3 Theme Design

Model-View-Controller. and. Struts 2

Payment Page Integration Guide

FileMaker 13. WebDirect Guide

Developers Guide. Designs and Layouts HOW TO IMPLEMENT WEBSITE DESIGNS IN DYNAMICWEB. Version: English

How to Configure edgebox as a Web Server

IBRI College of Technology Department of Information Technology. Intercollegiate Web Programming Contest On 12 March, 2013 (Tuesday)

Introduction to Tizen SDK Alpha. Taiho Choi Samsung Electronics

Themes and Templates Manual FOR ADVANCED USERS

Configuring IBM HTTP Server as a Reverse Proxy Server for SAS 9.3 Web Applications Deployed on IBM WebSphere Application Server

ASP.NET Using C# (VS2012)

FileMaker Server 11. FileMaker Server Help

Monitoring Oracle Enterprise Performance Management System Release Deployments from Oracle Enterprise Manager 12c

Business Application Development Platform

Super Resellers // Getting Started Guide. Getting Started Guide. Super Resellers. AKJZNAzsqknsxxkjnsjx Getting Started Guide Page 1

Chat Window Skinning Creation Guide

Getting Started with AWS. Hosting a Static Website

Digital Downloads Pro

Open Source Content Management System for content development: a comparative study

FileMaker Server 12. FileMaker Server Help

ADMINISTRATOR GUIDE VERSION

Acquia Introduction December 9th, 2009

Adobe Marketing Cloud How Adobe Scene7 Publishing System Supports SEO

Introduction to Web Technologies

Web Applications Testing

About ZPanel. About the framework. The purpose of this guide. Page 1. Author: Bobby Allen Version: 1.1

HTML5 and CSS3: New Markup & Styles for the Emerging Web. Jason Clark Head of Digital Access & Web Services Montana State University Libraries

Open-Source Shopping Cart Solutions. Installation information for integrating a shopping cart with Checkout by Amazon using open-source solutions

Startup Guide. Version 2.3.9

BT MAGAZINE. JOOMLA 3.x TEMPLATE. Total User Guide Version 1.0. Copyright 2013 Bowthemes.com

SizmekFeatures. HTML5JSSyncFeature

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

FileMaker 14. WebDirect Guide

Website Design & Development Deliverables

AJAX and jmaki for Web 2.0 Development using Java. Inyoung Cho Java Technology Evangelist Sun Microsystems, Inc.

COURSE CONTENT FOR WINTER TRAINING ON Web Development using PHP & MySql


Configuring Web services

The Great Office 365 Adventure

shweclassifieds v 3.3 Php Classifieds Script (Joomla Extension) User Manual (Revision 2.0)

Developing Web Views for VMware vcenter Orchestrator

Installation & Maintenance Guide

Web Page Redirect. Application Note

GOA365: The Great Office 365 Adventure

Configuring and Monitoring HP EVA StorageWorks Array

Transcription:

Chapter 8: Laravel Route View Asst.Prof.Dr. Supakit Nootyaskool Information Technology, KMITL Ref. Raphaël Saunier, Getting Started with Laravel 4, Packt Publishing, 2014

Objective Explain how to write a JavaScript code to web Demonstrate how to create a calculation part on client-side. Tell how to apply JavaScript in a webpage.

Topics What is Laravel Architecture of Laravel Route View

What is Laravel Laravel is open-source PHP framework. Laravel is tool for developing web application using concept of model-view-control (MVC) Laravel developed by Taylor Orwell by first release June 2011. www.laravel.com

MVC? Ref. https://en.wikipedia.org/wiki/model-view-controller

Laravel directories./app/ # Your Laravel application./app/commands/ # - Command line scripts./app/config/ # - Configuration files./app/controllers/ # - Controllers./app/database/ # - Database migrations and seeders./app/lang/ # - Localization variables./app/models/ # - Classes used to represent entities./app/start/ # - Startup scripts./app/storage/ # - Cache and logs directory./app/tests/ # - Test cases./app/views/ # - Templates that are rendered to HTML./app/filters.php # - Filters executed before/after a request./app/routes.php # - URLs and actions

From MVC to Laravel

Each step of designing 1. Get requirement from users 2. Design by drawing a wireframe 3. Show the wireframe and ask response from users 4. Write code 5. Test and Deployment 6. Training user

Design Header Manu bar (1,2,3) Contents (1,2,3) Footer

Laravel: Blade Templates Blead is a technique reduce overhead of webpage and giving easily manipulation. Blead idea is separation webpage to each part. Blead using suffix name is *.blade.php

Design header.blade.php Header Manu bar (1,2,3) manu.blade.php Contents (1,2,3) Footer footer.blade.php

1. Create Home Open route.php in directory root\larvel\app\ Add code below Route::get('/home', function() { echo "hello world"; exit; });

Output Change URL to http://localhost:8080/laravel/public/home

2. Crete master page Change directory to \root\laravel\app\views and create a file master.blade.php Add code below <!DOCTYPE HTML> <html> <head> <meta content="text/html, charset=utf-8"/> <title> Intro to Master Blade </title> <link rel="stylesheet" type="text/css" href="{{asset('css/bootstrap.css')}}"> <link rel="stylesheet" type="text/css" href="{{asset('css/bootstraptheme.min.css')}}"> <script src="{{asset('js/bootstrap.js')}}"> </script> </head> <body> Header <br> Menu <br> Home <br> Content1 <br> Content2 <br> footer <br> </body> </html>

Output

Laravel commands @yield( file.php ) @section( file.php ) @extends( reference part ) @section( reference part )

3.Create contents Create a file home.blade.php place at \root\laravel\app\views Type code below @extends('master') @section('content') <div class = "well"> This is Home zone </div> @stop

Edit master.blade.php by adding some code <!DOCTYPE HTML> <html> <head> <meta content="text/html, charset=utf-8"/> <title> Intro to Master Blade </title> <link rel="stylesheet" type="text/css" href="{{asset('css/bootstrap.css')}}"> <link rel="stylesheet" type="text/css" href="{{asset('css/bootstraptheme.min.css')}}"> <script src="{{asset('js/bootstrap.js')}}"> </script> </head> <body> Header <br> Menu <br> Home <br> @yield( content ) Content1 <br> Content2 <br> footer <br> </body> </html>

Output

4. Create page header and page footer Create a file pageheader.blade.php and pagefooter.blade.php placing in view directory <!-- START: pageheader --> <h1> My Web page </h1> <br> <hr> <!-- END: pageheader --> <!-- START: pagefooter --> <br> <hr> <br> copyright (c) 2015 <!-- END: pagefooter -->

Modify master.blade.php by <!DOCTYPE HTML> <html> <head> <meta content="text/html, charset=utf-8"/> <title> Intro to Master Blade </title> <link rel="stylesheet" type="text/css" href="{{asset('css/bootstrap.css')}}"> <link rel="stylesheet" type="text/css" href="{{asset('css/bootstraptheme.min.css')}}"> <script src="{{asset('js/bootstrap.js')}}"> </script> </head> <body> @include( pageheader ) Menu <br> Home <br> @yield( content ) Content1 <br> Content2 <br> @include( pagefooter ) </body> </html>

Output

5. Create two contents Copy home.blade.php and past with change filename to be content1.blade.php and content2.blade.php Give some contents in the files @extends('master') @section('content') <div class = "well"> This is content2 </div> @stop

Add new route Route::get('/c1', function() { return View::make('content1'); }); Route::get('/c2', function() { return View::make('content2'); });

Output

Summary