The simplest way to traverse the hierarchy tree with Baum is by iterating through the children
relation.
<?php
$root = Category::roots()->with('children')->first();
echo "<h3>{$root->name}</h3>";
foreach($root->children as $category) {
<html> | |
<head> | |
<title>Equality</title> | |
<script type = "text/javascript"> | |
var x = 42; | |
var y = "42"; | |
if (x ===y) { | |
document.write("x is equal to y with a strict test."); | |
} else { | |
document.write("x is not equal to y"); |
<?php | |
add_action('template_redirect','my_template_redirect'); | |
function my_template_redirect() { | |
if (get_post_type() == 'location') { | |
global $wp_query; | |
add_post_meta($wp_query->post->ID,'_wp_page_template','custom_template.php',TRUE); | |
$wp_query->is_page = true; | |
} | |
} | |
// custom template |
# sử dụng brew | |
$ brew install git-flow | |
# hoặc sử dụng port | |
$ port install git-flow |
$ apt-get install git-flow |
var app = { | |
data: {}, | |
jsf: { | |
extend: function (o) { | |
$.extend(true, app.data, o); | |
} | |
}, | |
msg: function(key){ | |
return (typeof app.data.msg[key] === 'undefined')? 'Message undefined' : app.data.msg[key]; | |
}, |
<?php | |
namespace App\Http\Controllers; | |
use App\Component\Common\PortalUser; | |
use App\Component\Common\PortalConst; | |
use App\Component\Common\PortalCommon; | |
use App\Repositories\ContentRepository; | |
use App\Repositories\GolfCourseRepository; | |
use Illuminate\Http\Request; |
var gsb = { | |
data:{}, | |
tags:[{"id":"1","name":"thanh 1"},{"id":"2","name":"thanh 2"},{"id":"3","name":"thanh 3"},{"id":"4","name":"thanh 4"},{"id":"5","name":"thanh 5"},{"id":"6","name":"thành 6"},{"id":"7","name":"luyen thi dai hoc"},{"id":"8","name":"luyen thi hoc sinh gioi"}], | |
jsf:{ | |
extend:function(o) { | |
$.extend(true, gsb.data, o); | |
} | |
}, | |
home: { | |
searching:false, |
<?php | |
use Illuminate\Auth\UserTrait; | |
use Illuminate\Auth\UserInterface; | |
use Illuminate\Auth\Reminders\RemindableTrait; | |
use Illuminate\Auth\Reminders\RemindableInterface; | |
use Zizaco\Entrust\HasRole; | |
class User extends Eloquent implements UserInterface, RemindableInterface | |
{ |
43B4A73YYJ-eyJsaWNlbnNlSWQiOiI0M0I0QTczWVlKIiwibGljZW5zZWVOYW1lIjoibGFuIHl1IiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTctMDItMjUifSx7ImNvZGUiOiJBQyIsInBhaWRVcFRvIjoiMjAxNy0wMi0yNSJ9LHsiY29kZSI6IkRQTiIsInBhaWRVcFRvIjoiMjAxNy0wMi0yNSJ9LHsiY29kZSI6IlBTIiwicGFpZFVwVG8iOiIyMDE3LTAyLTI1In0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMTctMDItMjUifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAxNy0wMi0yNSJ9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAxNy0wMi0yNSJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDE3LTAyLTI1In0seyJjb2RlIjoiUEMiLCJwYWlkVXBUbyI6IjIwMTctMDItMjUifSx7ImNvZGUiOiJSTSIsInBhaWRVcFRvIjoiMjAxNy0wMi0yNSJ9LHsiY29kZSI6IldTIiwicGFpZFVwVG8iOiIyMDE3LTAyLTI1In0seyJjb2RlIjoiREIiLCJwYWlkVXBUbyI6IjIwMTctMDItMjUifSx7ImNvZGUiOiJEQyIsInBhaWRVcFRvIjoiMjAxNy0wMi0yNSJ9XSwiaGFzaCI6IjMzOTgyOTkvMCIsImdyYWNlUGVyaW9kRGF5cyI6MCwiYXV0b1Byb2xvbmdhdGVkIjpmYWxzZSwiaXNBdXRvUHJvbG9uZ2F0ZWQiOmZhbHNlf |
The simplest way to traverse the hierarchy tree with Baum is by iterating through the children
relation.
<?php
$root = Category::roots()->with('children')->first();
echo "<h3>{$root->name}</h3>";
foreach($root->children as $category) {