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
0
votes
0 answers

Vercel Content-Type

im having problem with vercel deploy that returns status code 200 on errors, for ex. Flight::json(["message" => "Authorization is missing"], 403); will return {"message": "Authorization is missing"} with code 200. I think problem is that vercel has…
0
votes
0 answers

Can't convert JSON from UNICODE to UTF-8 using flightphp

This is my first time using flightphp so be nice with me, I have tried everything and still not working so here we go... I have this basic code in PHP using the micro-framework flightphp to create an API, in this specific case is just the method…
emiliorivas16
  • 119
  • 1
  • 7
0
votes
1 answer

Replace template engine in FlightPHP with Plates

the FlightPHP documentation outlines how to switch template engine to Smarty, but how would I instead switch to Plates? I have added Plates via composer and its autoloaded. From Custom Views section:…
Jason
  • 387
  • 3
  • 13
0
votes
0 answers

Use named placeholders in PHP ActiveRecord

I'm working on a API with FlightPHP and PHPActiveRecord that returns an array of Reports optionally filtered through url query string parameters. $allowed = ['author' => 'author_id', 'owner' => 'owner_id']; $options =…
markusand
  • 235
  • 7
  • 18
0
votes
1 answer

How to use mysqli on flight php framework

Flight php documentation says how can we use PDO connection to database. For instance Flight::register('db', 'PDO', array('mysql:host=localhost;dbname=test','user','pass')); $db = Flight::db(); $x=$db->query("SELECT * FROM `test_table` LIMIT 0,…
user1762634
0
votes
0 answers

Why does the server receive a GET request even if I performed a POST request?

I'm trying to create a POST API with Flightphp. I've wrote the following code: Flight::route('GET /addProduct', function(){ echo "GET REQUEST"; }); Flight::route('POST /addProduct', function(){ echo "POST REQUEST"; var_dump($_POST); …
alessandro308
  • 1,912
  • 2
  • 15
  • 27
0
votes
1 answer

URI rewritten in htaccess is not passed to php router

Edit: To pose the same question in a more general way: how can I rewrite a URL in htaccess so that the rewritten form will be seen in php's $_SERVER['REQUEST_URI']? If user requests an (existing) epub or mobi file via a URL, I want to capture and…
Marek Jedliński
  • 7,088
  • 11
  • 47
  • 57
0
votes
1 answer

Flight PHP RESTful API not returning HTTP Status header

I am using the Flight PHP Framework to develop a RESTful API in PHP. Everything is working perfect except for all my routes the response from the API always contains the HTTP Status '200' even if I set it as '403' or '500' using the PHP…
georgewoofbates
  • 320
  • 2
  • 15
0
votes
0 answers

.htaccess URL Rewriting not working in production

I am working an a small REST API with FlightPHP, and having an issue with the URL Rewriting. It is working fine on my development machine, but when I deploy it to production I am getting 404s for all routes other than the base '/' route. The 404…
user147215
0
votes
1 answer

pass function with argument to method call

I'm trying to use flight PHP framework for routing and medoo framework for database usage. //connect database $database = new medoo([ 'database_type' => 'sqlite', 'database_file' => 'db.sqlite' ]); //my function function…
0
votes
1 answer

How to inject framework into custom class?

I'm currently developing an application with the FlightPHP framework and wondering how am I able to inject FlightPHP into my custom class so that I am able to use specific classes I have injected into it's dependency container. use Flight; use…
mhvvzmak1
  • 307
  • 2
  • 12
0
votes
1 answer

Having Problems trying to encode json from php

So, this is my php code: $lista = Producoes::getPublicList(); if(count($lista) > 0){ $jsonObj = array(); foreach ($lista as $post){ $jsonPost = array(); $jsonPost["id"]=$post->id_post; …
kalangaum
  • 19
  • 6
0
votes
1 answer

Wamp and flightphp not working together

This is my repository on github. When i go on http://localhost:port/PS-PKCalypso/rest/ - i get my hello nestos! But, when i go to http://localhost:port/PS-PKCalypso/rest/sada - i get 404 not found error. On my wamp i have changed AllowOverride to…
Uruk Maat Ra
  • 145
  • 1
  • 12
0
votes
1 answer

Multiple times using Flight::render in framework

I'm trying to build a small website using the Flight php framework. The goal is to have a clear framework using various views. Until this point everything is working fine, I managed to build a nice framework.php and an content, menu and header…
ConradM
  • 11
  • 5
0
votes
0 answers

Call to a member function fetch() error while using cache class in Flight framework

I was allways using same cache class to cache array of element into file and it worked fine every time. But when I'm trying to use it with Flight PHP micro framework, I cant get it work. Here is my index.php part which directs to pages witch…
DadaB
  • 762
  • 4
  • 12
  • 29