This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<link rel=”stylesheet” href=”style.css”> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layout') | |
@section('contents') | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="card"> | |
<div class="card-header"> | |
<h3 class="card-title">{{$title}}</h3> | |
</div> | |
<div class="card-body"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Illuminate\Routing\Controller as BaseController; | |
class SpreadsheetController extends BaseController | |
{ | |
function import(Request $request){ | |
$title = "Import Spreadsheet"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package visitorpatern; | |
public class VisitorPattern { | |
public static void main(final String[] args) { | |
//visit all children nodes | |
StaticData.PERSON.acceptChildren(new PersonRecursiveVisitor() { | |
@Override | |
public void visit(Person person) { | |
//visit and print the person name | |
System.out.println(person.getName()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package visitorpatern; | |
public class VisitorForLoop { | |
public static void main(final String[] args) { | |
//print all children using for loop | |
VisitorForLoop.printAllChildren(StaticData.PERSON); | |
} | |
static void printAllChildren(Person person){ | |
for (Person person1: person.getChildren()){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package visitorpatern; | |
import java.util.Arrays; | |
public class StaticData { | |
final public static Person PERSON = Person.of("root", Arrays.asList( | |
Person.ofName("foo1"), | |
Person.ofName("bar1"), | |
Person.of("baz1", Arrays.asList( | |
Person.ofName("foo2"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package visitorpatern; | |
abstract class PersonRecursiveVisitor { | |
public void visit(Person person){} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package visitorpatern; | |
import lombok.Data; | |
import java.util.Collections; | |
import java.util.List; | |
@Data | |
class Person { | |
private String name; |