本文整理汇总了PHP中F3::serve方法的典型用法代码示例。如果您正苦于以下问题:PHP F3::serve方法的具体用法?PHP F3::serve怎么用?PHP F3::serve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F3
的用法示例。
在下文中一共展示了F3::serve方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
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');
}
示例2: file
/**
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');
}
示例3: render
function render()
{
echo F3::serve('layout.htm');
}
示例4: test
function test()
{
echo F3::serve("example.htm");
}
示例5: Axon
<?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);