fatfreeframework PHP数据库加载和打印

时间:2018-08-03 15:17:40

标签: php html fat-free-framework

  public function profil(\Base $app)
{
    $hlasy = new data\Hlasy();
    $tit = new data\Titul();

    $tit->load(array('child=?',$app->get('SESSION.user[uuid]')));
    $app->set('stathrace',array($tit->parent));
    $hlasy->load(array('uuid=?', $app->get('SESSION.user[uuid]')));
    $app->set('stathrace', $hlasy->AllTimeTotal);






    echo \Template::instance()->render('profil.html');
}

                  <this is HTML>
   <repeat group="{{ @stathrace}}" value="{{ @stat }}">
                <tr>
                    <td>{{ @stat.parent }} </td>
                    <td>{{ @stat.AllTimeTotal }} </td>
                    <td> X</td>
                    <td> X</td>
                    <td> X</td>
                    <td> X</td>
                </tr>

            </repeat>

为foreach()提供的参数无效 我不知道怎么解决 我需要找到uuid('SESSION.user [uuid]')的播放器ID ..并使用它来加载数据库并获取父数据(例如money)和下一个数据库($ hlasy)之类的数据,然后再次加载该uuid并进行分配来自播放器

1 个答案:

答案 0 :(得分:0)

enter code here

公共函数profil(\ Base $ app)

    $penize = new data\Penize();
    $hlasy = new data\Hlasy();
    $tit = new data\Titul();

    $tit->load(array('child=?',$app->get('SESSION.user[uuid]')));
    $hlasy->load(array('uuid=?', $app->get('SESSION.user[uuid]')));
    $app->set('stathrace',array(($tit->parent),($hlasy->AllTimeTotal)));






    echo \Template::instance()->render('profil.html');
}




         <repeat group="{{ @stathrace}}" value="{{ @stat }}">
    <td style="width:20%;color:deepskyblue; text-align:center";>{{@stat }} </td>
                        </repeat>