Question

I am brand new to the Fat-Free-Framework F3 for PHP
I am trying to build a blog
I have a simple query

'SELECT * FROM blogs  ORDER BY created DESC LIMIT 5'  

I want to build this query using the Axon ORM that is built in to the F3 framework

In my thinking I want to try this:

     $blogs = new Axon('blogs');
     $blogs->load(array('limit'=>5, 'order by'=>'created', 'order'=>'DESC'));

Is this the correct way?
Does anyone know of any good Axon documentation?

Thanks

Was it helpful?

Solution

This will do it. You can loop through $posts as Axon objects now.

$blogs = new Axon('blogs');
$posts = $blogs->find('','created DESC',5);

While Fatfree seems simple and easy, it pales in comparison to what is out there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top