私のlaravelサイトがエラーを返しています。私は次のコードを使用しています:
@extends('base')
@section('title', 'Experience stages')
@stop
@section('main')
<div class="container">
<div class="doc-content-box">
<legend>Experience stages</legend>
<?php
$stagesdir = 'C:\Users\E1\Desktop\theforgottenserver-v0.2.15-win64console\Mystic Spirit\data\XML';
if(is_dir($stagesdir)) {
$list = simplexml_load_file($stagesdir.'\stages.xml');
?>
<table class="table table-striped">
<thead>
<tr>
<th>From Level</th>
<th>To Level</th>
<th>Experience multiplier</th>
</tr>
</thead>
<tbody>
<?php
foreach($list->children() as $stage) {
if ($stage['maxlevel'] == '') {
$stage['maxlevel'] = '*';
}
echo '
<tr>
<td>'.$stage['minlevel'].'</td>
<td>'.$stage['maxlevel'].'</td>
<td style="width: 30%">'.$stage['multiplier'].'x</td>
</tr>';
}
}
else{
echo '<div class="alert alert-danger"><span class="label label-important">Error parsing your Monsters XML file</span><br /><br /> Invalid path!</div> ';
}
?>
</tbody>
</table>
</div>
</div>
@stop
そのforeachでは、使いたく$list->world->children()
ないのですが、うまくいきません。ページを実行しようとすると、次のエラーが表示されます。
main(): Node no longer exists
また、ここに私の XML ファイルがあります: http://paste.laravel.com/Koh
なしで使用することもできます->world
が、XML ファイルでわかるよう<td>
に、テーブルでは のように機能します。