PHP - "Fat Free Framework" Find Methods and Showing Results in Template

Posted by user1672808 on Stack Overflow See other posts from Stack Overflow or by user1672808
Published on 2012-09-15T03:36:25Z Indexed on 2012/09/15 3:37 UTC
Read the original article Hit count: 295

Filed under:
|
|
|
|

Just started trying the "Fat Free Framework"

  • I'm building a site using a MySQL DB with 265 fields, and 5000+ rows in the DB;
  • I can load() a specific record easily, no problems.
  • When using find(), afind(), and even "select()", template will show blank lines or lines with "filler" text, with the correct number of rows for the query results, but no text/data from the DB itself;
  • Same problem whether using objects or simply arrays from result (afind() and find()). I've copied/pasted the code verbatim from examples and from documentation, with only the DB specific items changed. Still, no luck.

CODE IN PHP FILE (function from CLASS):

static function home() {
    $featured=new Axon('boats');
    $F3::set('boatlist',$featured->afind('D_CustomerID=173'));
    F3::set('content',TEMPLATE_DIR .'/home.html');
    echo Template::serve(TEMPLATE_DIR .'/layout.html');

}

TEMPLATE home.html:

<div class="span8">
<h3>
    Featured Boats
</h3>
<F3:repeat group="{{@boatlist}}" value="{{@boat}}">
<div style="margin-left: 2em" class="thumbnails">
    <p>
        <a href="boat/{{@boat['D_BoatNum']}}">{{trim(@boat['D_Description'])}}</a> by {{@boat['D_CustomerID']}}
    </p>
    <p>
        {{@boat['D_Price']}}
    </p>
</div>
</F3:repeat>
</div>

The number of rows this produces coincides with the correct number of rows in the DB. However, the actual data from each field does not show.

Any ideas?

© Stack Overflow or respective owner

Related posts about php

Related posts about php5