atk4 / api Goto Github PK
View Code? Open in Web Editor NEWImplementation of RestAPI for Agile Data
Home Page: https://agiletoolkit.org/
Implementation of RestAPI for Agile Data
Home Page: https://agiletoolkit.org/
if I Use this it works; print all Json array
$api->rest('/customers', new Customers($db));
but if I use this, it does not work why? it print empty Json array
$api->rest('/customers', function() use($db) {
$c = new Customers($db);
$c->setLimit(20);
return $c;
});
any ideas?
Hi,
when passing URL params to the api, the Api->rest() does not work as supposed. Furthermore, if the last part of the pattern is a variable (e.g. :id), the URL params are added to this variable
pattern setup:
$this->rest('/bookings', new Booking($this->app->db));
This request is not recoqnized:
www.mydomain.com/api/bookings?access_token=123456
DELETE www.mydomain.com/api/bookings/3?access_token=123456
=> id which should be 3 becomes 3?access_token=123456
My proposal:
Raise code coverage
I have a table with a column text with French and Spanish characters and the JSON returned from the API gives me error
Fatal error: Uncaught InvalidArgumentException: Unable to encode data to JSON in Zend\Diactoros\Response\JsonResponse: Malformed UTF-8 characters, possibly incorrectly encoded in /Applications/MAMP/htdocs/www/cpanel_tripsbro/vendor/zendframework/zend-diactoros/src/Response/JsonResponse.php:164 Stack trace: #0
I think the issue it is the charset problem... my table is utf-8 charset in the db and header and html charset is ok but the issue it is from the API returning malformed Json when the column has accents in the field to show...
is there a way to set charset when using the line below?
$db = new \atk4\data\Persistence_SQL connection here?
or where?
thanks
I have many relational tables and I want to retrieve all relational tables that belongs to the one I am pulling the information I tried many things to try to show the relational tables using the API but do not find any hook for it...
for instance show all clientes and clientes can have many addresses and groups...
I want to show the client with the addresses and group he/she belongs...
One clear example will be:
I have a post table that has comments (made by users) and the posts can have tags.
how can I join these tables for output with this API? is there any solution for this?
Appreciate any info
thanks
Composer message:
Package zendframework/zend-diactoros
is abandoned, you should avoid using it. Use laminas/laminas-diactoros
instead.
composer require atk4/data
composer require atk4/api
will produce an error
Problem 1
- Root composer.json requires atk4/api ^0.3.0 -> satisfiable by atk4/api[0.3].
- atk4/api 0.3 requires atk4/data ^2.0 -> found atk4/data[2.0.0, ..., 2.4.0] but it conflicts with your root composer.json require (^5.0).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.