fat-free-framework

fat-free framework only working through cli

女生的网名这么多〃 提交于 2020-03-06 02:24:48
问题 I just started trying to use the fat-free framework. I don't understand what i am doing wrong here. I have the following code that i got from their site: $f3 = require('/var/tmp/fatfree-master/lib/base.php'); $f3->route('GET /', function() { echo 'Hello, world!'; } ); $f3->run(); ?> When i run the following code using the cli, like this php index.php it works fine. But when i try to go to it with a browser i get the following error: Not Found HTTP 404 (GET /index.php) I don't understand how

Fat Free Framework PHP Sql statement with in expression

这一生的挚爱 提交于 2020-03-03 07:50:28
问题 I'm trying to include a list of strings to be used in an "in" expression in a sql statement for example: select * from poop where id in ('asd','sas','ser') I want to pass the in parameter from a variable. The quoting is really screwing me up. Should I be passing this as a string which I have been trying to no avail by making a comma seperated string that looks like this: 282366381A,240506808A,244154247A,491404349A,242443808B,328409296A,239723812A,383423679M or "282366381A","240506808A",

Get information about the route executed in Fat Free v3

穿精又带淫゛_ 提交于 2020-01-14 14:11:57
问题 I'd like to know which route is executed according to current URL in the beforeRoute method in the Fat Free Framework. In other words, can I get which class and which method will be executed? I had info about about the pattern (URL) in PATTERN variable but I don't know which class and method is going to be executed for this PATTERN as mapped in routes.ini. Example of my routes.ini: GET /admin=Controllers\Admin\Admin->index In this case I'd like to find that the class is Controllers\Admin

Simple problem with mod_rewrite in the Fat Free Framework

亡梦爱人 提交于 2020-01-10 03:03:18
问题 I am trying to setup and learn the Fat Free Framework for PHP. http://fatfree.sourceforge.net/ It's is fairly simple to setup and I am running it on my machine using MAMP. I was able to get the 'hello world' example running just fin: require_once 'path/to/F3.php'; F3::route('GET /','home'); function home() { echo 'Hello, world!'; } F3::run(); But when I try to add in the second part, which has two routes: require_once 'F3/F3.php'; F3::route('GET /','home'); function home() { echo 'Hello,

php f3 framework use aggregation framework pipeline with mongo mapper

做~自己de王妃 提交于 2020-01-07 03:50:09
问题 I want to sue aggregation framework pipeline with mongo mapper in the transaction table, the result should be something like this: Suppose I have 7000 transactions in a collection with status 1,2,3,4 (1=pending, 2=confirmed, 3=decline, 4=claimed) Data Representation: Pending Count | Confirmed Count | Decline Count | Claimed Count 4000 2000 1000 0 1. The issue is I'm not sure which field should be used for the key in the group. My code is returning me all records which match the criteria.

Fat-Free-Framework global variables and functions

耗尽温柔 提交于 2019-12-29 06:57:26
问题 I'm new to fat free framework and i'm a little bit confused about the global variables. $f3->route('GET /@page','display'); function display($f3) { echo 'I cannot object to an object' . $f3->get('PARAMS.page'); }; $f3->run(); Here i'm using GET /@page as a token for the url route. In the function i then use $f3->get('PARAMS.page') to get the value of that variable. Since $f3->get is the method to get a global variable, why do i have to pass the $f3 class to the function. The below code doesn

FatFree routing not working in production

随声附和 提交于 2019-12-24 02:15:26
问题 I have an application with many routing paths as follows- F3::route('GET /', 'Main->get_front_page'); F3::route('GET /login/check_for_login', 'Login->check_for_login'); The first route is matching properly. However, the second route is not matching and I am getting a 404. Infact, any route after the first one are not matching. To make matters more complicated, all the routes are working on my local machine. 回答1: Check your apache .htaccess file. Especially the RewriteBase url. I often tend to

F3 changes relative URi of css files

眉间皱痕 提交于 2019-12-23 15:07:09
问题 I am a newb experimenting with F3. My sample app is basically working but references to css files get changed and result in not being found. It looks like a .htaccess problem but I can't seem to fix it. My css files are specified as <link rel="stylesheet" href="ui/css/base.css" type="text/css" /> <link rel="stylesheet" href="ui/css/theme.css" type="text/css" /> <link rel="stylesheet" href="lib/code.css" type="text/css" /> My .htaccess file looks like RewriteBase /blog/ RewriteCond %{REQUEST

Notice: Unknown: file created in the system's temporary directory in Unknown on line 0

你。 提交于 2019-12-10 21:21:26
问题 I'm simply using a html form to upload a file. But I'm getting below error: Notice: Unknown: file created in the system's temporary directory in Unknown on line 0 Here's my HTML: <form name="import" method="post" action="CSVUpload" enctype="multipart/form-data"> <input type="file" name="file" /><br /> <input type="submit" name="submit" value="Submit" /> </form> Here's the route: $f3->route('POST|PUT @CSVUpload: /CSVUpload', 'GBD\Internals\Controllers\LeaveController->csvHandler'); $f3->route(

How do I loop through the mysql resultset in fatfree framework?

…衆ロ難τιáo~ 提交于 2019-12-09 01:31:27
问题 I am new to the php fat-free framework, and I am trying figure out how to loop through my mysql query results, or better yet, get it as an associative array (for learning purposes only). What I did so far is while(!$users->dry()){ array_push($user_assoc,$users->cast()); $users->next(); } This works, but I was wondering if there is a better way of doing this? Also how do I setup a error handler? I mean how do I check if the query had any errors (i.e. fat-free equivalent of mysql_error() )? 回答1