Beispiel #1
0
function main()
{
    F3::set('name', 'world');
    F3::set('buddy', array('Tom', 'Dick', 'Harry'));
    F3::set('gender', 'M');
    F3::set('loggedin', 'true');
    F3::set('div', array('coffee' => array('arabica', 'barako', 'liberica', 'kopiluwak'), 'tea' => array('darjeeling', 'pekoe', 'samovar')));
    F3::set('rows', array(1, 2, 3, 4, 5));
    echo F3::serve('5template.htm');
}
Beispiel #2
0
/**
	The function below could have been saved as an import file (render.php)
	loaded by the F3::route method like the other route handlers; but let's
	embed it here so you can see how you can mix and match MVC functions
	and import files.

	Although allowed by Fat-Free, functions like these are not recommended
	because they pollute the global namespace, specially when it's defined
	in the main controller. In addition, the separation of the controller
	component and the business logic becomes blurred when we do this - not
	good MVC practice.

	It's all right to define the function here if you're still figuring out
	the structural layout of your application, but don't trade off coding
	convenience for good programming habits.
**/
function render()
{
    // layout.htm is located in the directory pointed to by the Fat-Free
    // GUI global variable
    echo F3::serve('layout.htm');
}
Beispiel #3
0
function render()
{
    echo F3::serve('layout.htm');
}
Beispiel #4
0
function test()
{
    echo F3::serve("example.htm");
}
Beispiel #5
0
<?php

// Retrieve blog entries
$kul = new Axon('kul');
F3::set('entries', $kul->find());
/**
	We could have just as easily accomplished the above using the following:
		F3::sql('SELECT title,entry,time FROM blogs;');
		F3::set('entries',F3::get('DB.result'));
**/
echo F3::serve('rss.xml', FALSE);