Comments (6)
I think I found the Issue the API.php installed with composer it is old version I have to replace it with the download and it works now!!!
composer installation must be updated!!!
thanks
from api.
Do you use develop branch in your composer.json file?
"atk4/api": "dev-develop",
from api.
yes I do, It was installed with the installation of the api using composer
from api.
I am trying to use the optional args
Like explained here:
Optional Arguments
Agile API supports various get arguments.
?sort=name,-age specify columns to sort by.
?q=search, will attempt to perform full-text search by phrase. (if supported by persistence)
?condition[name]=value, conditioning, but can also use ?name=value
?limit=20, return only 20 results at a time.
?skip=20, skip first 20 results.
?only=name,surname specify onlyFields
?ad={transformation}, apply Agile Data transformation
but it does not work!!! gives me an empty array!!! nothing... any option return the same empty array if I use optional args..
any tip what am I doing wrong?
I am trying to add this, to see if this is missing in my php file but if I include it or not the optional args does not return anything...
function args(\atk4\data\Model $m) {
if ($_GET['sort']) {
$m->sortBy($_GET['sort']);
}
if ($_GET['condition']) {
foreach($_GET['condition'] as $key=>$val) {
$m->addCondition($key, $val);
}
}
if ($_GET['limit'] || $_GET['skip']) {
$m->setLimit($_GET['limit']?:null, $_GET['skip']?:null);
}
// etc. etc...
}
any tips?
In the sample files of the API there is no examples for optional arguments or auth... I am planning to use it to feed a mobile app this api and I need first test that all working fine...
most important things are...
to be able to filter or sort or show only some fields
limit the api to get and post request...
and auth for users that are authorised are only able to use the api for making get request...
thanks
from api.
Sometimes Composer doesn't update github repos. This shit happens. @romaninsh will check that when he will return from vacation.
Speaking about some aspects which are described in readme - yes, not everything is implemented yet and some things could be implemented different than in readme. This repo still is under construction. We use it in few our projects, but only in simple way - for quickly setting up simple REST interface.
Anyway - it's all in our ToDo list and will be developed in near future. Also you can help us and send in some PRs :)
from api.
Great :) of course!
from api.
Related Issues (7)
- URL params (?param1=somevalue) mess up rest patterns HOT 1
- Raise code coverage HOT 2
- "zendframework/zend-diactoros" is abandoned
- Doesn't work with new versions of data
- error: charset malformed JSON... this happen with columns fields from db with specials characters... any fix? HOT 7
- What about a relational table JOINS and its data? anything? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api.