本文整理汇总了PHP中Node::build方法的典型用法代码示例。如果您正苦于以下问题:PHP Node::build方法的具体用法?PHP Node::build怎么用?PHP Node::build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Node
的用法示例。
在下文中一共展示了Node::build方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
/**
* @param Board $board
* @param int $depth
*/
protected function build(Board $board, $depth)
{
$board->write('INSERT INTO ');
$this->table->build($board, $depth + 1);
$board->write(" (");
$this->columns->build($board, $depth + 1);
$board->write(")\n");
$this->data->build($board, $depth + 1);
}
示例2: build
/**
* @param Board $board
* @param int $depth
*/
protected function build(Board $board, $depth)
{
$board->write('UPDATE ');
$this->table->build($board, $depth + 1);
$board->write("\n");
$board->write("SET ");
$this->data->build($board, $depth + 1);
$where = $this->where;
if ($where) {
$board->write("\n");
$board->write('WHERE');
$board->write($where->isBlock() ? "\n" : " ");
$where->build($board, $depth + 1);
}
}
示例3: buildPart
/**
*
* @param string $part
* @param Node|null $node
* @param Board $board
* @param int $depth
*/
protected function buildPart($part, $node, $board, $depth)
{
if ($node) {
$indent = $board->indent($depth);
$board->write($indent)->write($part);
$board->write($node->isBlock() ? "\n" : ' ');
$node->build($board, $depth + 1);
$board->write("\n");
}
}
示例4: array
$markup .= $indent_chr . $indent_chr . $indent_str . '<span class="datum ' . $key . '">' . $value . '</span>' . "\n";
$markup .= $indent_chr . $indent_chr . $indent_str . '</li>' . "\n";
}
$markup .= $indent_chr . $indent_str . '</ol>' . "\n";
}
if (is_array($val->getChildren())) {
$this->nestList($val, $depth + 1, $markup);
}
$markup .= $indent_chr . $indent_str . '</li>' . "\n";
}
$markup .= $indent_str . '</ol>' . "\n";
}
return;
}
}
$nodeTree = Node::build('root');
$nodeTree->setData(array('123' => 'abc'));
$nodeTree->insertByPath($nodeTree, 'root/A');
$nodeTree->insertByPath($nodeTree, 'root/B');
$nodeTree->insertByPath($nodeTree, 'root/B/C');
$nodeTree->insertByPath($nodeTree, 'root/B/D', array('foo' => 'a', 'bar' => 'b', 'baz' => 'c'));
$nodeTree->insertByPath($nodeTree, 'root/B');
$nodeTree->insertByPath($nodeTree, 'root/D/F/G/H/I');
#echo var_dump($nodeTree);
#$markup = '';
#$markup .= '<!DOCTYPE html>' . "\n";
##$nodeTree->nestDiv(null, 1, $markup);
#$nodeTree->nestList(null, 1, $markup);
$markup = '';
$markup .= '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
$markup .= '<nodePath>' . "\n";