Questions tagged [flightphp]

Flight is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications.

Flight is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications.

Requirements

Flight requires PHP 5.3 or greater.

License

Flight is released under the MIT license.

Official repository and issue tracker: https://github.com/mikecao/flight

Official website: http://flightphp.com

36 questions
5
votes
1 answer

PDO : insert 3 rows instead in mysql when i insert just 1 row

I use PDO in my php framework (flight) and i have a ridiculous problem. When i insert 1 row into the mysql i saw 3 rows inserted . Flight::db()->query("INSERT INTO `menu_item`(`order`, `menu_cat_id`) VALUES (22,1)"); This is My whole code…
4
votes
2 answers

Flight PHP Routing from Subdirectory

So I'm using the Flight PHP microframework (http://flightphp.com/) to do routing. My question is, how can I run the router from within a subdirectory? What I mean is, essentially, run it 'sandboxed' within a folder. As in, a request to '/' just…
Aristides
  • 3,805
  • 7
  • 34
  • 41
3
votes
2 answers

React Native Fetch Return Network Request Failed

I am developing a simple app using React Native. I am testing it on Genymotion Android Emulator. I have created local web server to listen to the requests, it is running at http://localhost:8082/API/. I have tested the api and is working right.…
Denny Rachmadi
  • 163
  • 1
  • 3
  • 15
2
votes
5 answers

I don't understand routing

I am trying to learn a PHP framework. But I'm having some difficulties understanding some of the concepts of routing. I've chosen to use Flight. Their homepage shows: require 'flight/Flight.php'; Flight::route('/', function(){ echo 'hello…
PIJNSO678
  • 86
  • 8
2
votes
1 answer

Running a secondary PHP app from a subdirectory in Nginx

I have a site built on the Kirby flat file CMS and its running in the root directory just fine, but I'm trying to get an instance of FlightPHP running in a subdirectory (called crm) of the above project. This FlightPHP instance will handle form…
ghstcode
  • 2,902
  • 1
  • 20
  • 30
2
votes
2 answers

The $_POST data is empty even though I'm getting a 200 response on the POST?

I've got a PHP application that uses AngularJS for the client, FlightPHP for REST services, and PHP in the back end. However, even though I'm issuing a POST with this code here: $scope.registerUser = function() { $http({ method: 'POST', …
Mike Perrenoud
  • 66,820
  • 29
  • 157
  • 232
1
vote
3 answers

Passing variables to obejct method on Flight PHP

According to the Flight PHP documentation, to use an object method is by using: Flight::route('/some/route', [$object, 'method']); and to use route parameters is by using: Flight::route('/@name/@id', function($name, $id){ echo "hello, $name…
1
vote
1 answer

PHP REST Service is really slow

I'm having a problem with my PHP REST service, it is really slow. I build it with the Flight PHP Framework. It's accessing data from a MySQL database and returns them as json. Flight REST Service: Flight::route('GET /categories', function(){ …
mbauer
  • 348
  • 1
  • 6
  • 25
1
vote
1 answer

Create Json using Flight php

I have a problem where I have to create a JSON using Flight::json. I have an array, called $data, that contains some elements like $data[] = array('id'=>$temp,'type'=>'remote','url'=>$path); where $id and $path have different values like…
user3836982
  • 148
  • 1
  • 13
1
vote
1 answer

Upload files with FlightPhp micro-framework

I already search this question on internet and on this forum, but I don't see any answers for this. The question is How to upload files with flightphp micro-framework with DropZonejs or others. I have some code: DropZone:
Evgeny B.
  • 11
  • 6
1
vote
3 answers

Set header HTTP code in Flightphp

im developing an API with FlightPHP microframework and I can't set an HTTP response code for my routes. I can set this and works perfectly: header('HTTP/1.0 500 Error'); But I want use the native function http_response_code() from PHP. This one…
1
vote
1 answer

FlightPHP after register a class cant find method

I started some days ago with FlightPHP. Now I created my own model called imagePreviewModel. Here is the model: db = $db; } public…
MyNewName
  • 1,035
  • 2
  • 18
  • 34
1
vote
1 answer

Flight PHP PUT method is not getting data

I hope you're good. I'm working on an inventory system and I'm using FlightPHP to create the REST because is very light and i used to work in another projects before. But right now, I have a trouble with that framework and I tried to find a…
1
vote
1 answer

How can I add autocompletion for Flight PHP microframework in PHPStorm

I've started using Flight microframework, but all methods are hidden under the hood (not declared in the Flight class). How can I configure PHPStorm or should I write new set of rules? Update: use framework instance doesn't work I've tried to use…
terales
  • 3,116
  • 23
  • 33
1
vote
4 answers

PHP Flight Micro framework POST data as array

I'm using the PHP Flight micro framework (http://flightphp.com/). On a POST request, the variables can be retrieved by using Flight::request()->data (http://flightphp.com/learn#requests). As is, it appears to be typed: flight\util\Collection Object.…
Jason
  • 4,079
  • 4
  • 22
  • 32
1
2 3