Most voted "slim" questions
Slim is a micro framework in PHP for the development of simple applications and Apis.
Learn more…76 questions
Sort by count of
-
15
votes1
answer3432
viewsWhat is the purpose of Middleware in relation to Apis and Web Applications made in Slim?
I’m reading regarding Middleware no framework Slim, however, I could not understand the purpose of Middleware in relation to Rest Apis or Web Applications built in Slim. I was also talking to…
-
11
votes2
answers2058
viewsWhat would the route model look like for a Rest API in more complex operations?
I did some research on the REST API model, but among the many questions I had, I have one that is essentially important. People always gave examples of route models that looked like this:…
-
6
votes1
answer592
viewsSlim Framework PHP Routes
Hello folks I’m having trouble using the Slim framework... when I try to access via get the root "/" I can normal, but when I try to access other methods like "/hello" it simply n goes, error " Not…
-
5
votes1
answer1203
viewsWhat is the best method to log in to android and webservice php Restful?
I am building an application that needs login, I have already created the webservice in php using Slim. I am currently using a POST, passing a json with email and password for the webservice to…
-
5
votes3
answers756
viewsSend parameters via GET
I’m making a requisition the following way. http://localhost/sistema-agenda-server/tarefas/listAll?id=1 I asked to see in the answer the generated sql and got the following answer: SELECT * FROM…
-
3
votes2
answers578
viewsSlim routing does not work
I’m trying to use the Slim Framework following the documentation for the same, configured mod_rewrite and installed mcryp; If I call http://localhost/slim/books have: Not Found If I call…
-
3
votes1
answer335
viewsRender view through controller using Slim Framework 3
I’m trying to find a way to render the view using a controller on slim framework but for some reason I’m getting the error: Message: Using $this when not in object context The function is a public…
-
3
votes1
answer488
viewsSlim error Badrouteexception
Checking the logs on the server found the following error: Slim Application Error: Type: FastRoute\BadRouteException Message: Static route "/client/schedules" is shadowed by previously defined…
-
2
votes1
answer277
viewsAngularjs website accessing API, authentication doubt
I have an API written in PHP+Slim, which is being used by an administrative panel, and the authentication is via token, which is returned when the panel user logs in. However, I am making a site…
-
2
votes1
answer138
viewsView Datetime Content using Doctrine
In a Webservice project using Slimframework, I decided to add Doctrine to the BD queries. I decided to follow the guidance of DOCTRINE to work with Datetime and Time Zones according to this site…
-
1
votes1
answer321
viewsProblems with SLIM paging with Pager
How to change page using Pear-Pager in SLIM Framework? The code of router is: $app->get('/imoveis(/:pg)', function($pg = '') use($app) { $imoveis = array('casa 1', 'casa 2', 'casa 3', 'casa 4',…
-
1
votes0
answers392
viewsVariable Slim Frameworks between Routes
How to pass result from one route to another in Slim Frameworks ex: $app->get('/rota1/:param', function($param) use ($app, $myclass) { // rotina que retornará um array $myArr =…
-
1
votes1
answer228
viewsPOST - Slim PHP
I’m a beginner in webservices and I’m studying on top of Slim (PHP) but I’m having a little problem saving something in the database. My job to try to save a new category in the bank is as follows:…
-
1
votes0
answers117
viewsSlim Framework status code 404
When making requests I get the following error. Xmlhttprequest cannot load http://www.domain.com.br/api. Response for preflight has invalid HTTP status code 404 Man .htaccess is like this:…
php htaccess http-request http-headers slimasked 8 years, 5 months ago willian rodrigues andrade 85 -
1
votes0
answers57
viewsDoctrine, error when generating proxy
I would like some help, I’m getting this mistake from time to time, I’ve researched a lot, but nothing that helps me solve. As I said, this error is not always returned. In this application I am…
-
1
votes1
answer224
viewsError 500 when using Slim Framework with Twig
I’m developing a simple website, with Slim Framework and Twig for template engine, only that is returning the error 500 in the browser, this is the content of my file index.php (at the root of the…
-
1
votes0
answers64
viewsPDO for DOCTRINE - Haversine formula
I need to transfer the PDO query below to DOCTRINE: $query = $con->query('SELECT *, ( 6371 * acos( cos( radians('.$latitude.') ) * cos( radians( latitude ) ) * cos( radians( longitude ) -…
-
1
votes0
answers41
viewsSlimframework send json to another application url
I’m developing a system integration, and I’m using Slim Framework I’m using an Action called Cron <- was created by min. Cron has a method called checkComplited private function…
slimasked 7 years, 12 months ago Matheus Freitas 95 -
1
votes1
answer1229
viewsConfigure Slim Framework and Apache 2
Hello, good afternoon. I recently hired a linux hosting service. My site uses the Slim Framework, but I’m not able to access its routes when it’s in production, but in the xampp localhost, it was…
-
1
votes0
answers30
viewsPHP opauth facebook
I am making attention with facebook using opauth.org slim3 framework. I’m not getting the sex. I get the other data: test site Does anyone know if there is a syntax error? $gender =…
-
1
votes1
answer145
viewsHow to Add Style Sheet to a Slim Framework Project
As I can configure a project that I can add css, js and bootstrap files in the slim framework, I used the slim/Skeleton project, but I can’t get my css and js files to work without the need to add a…
-
1
votes1
answer282
viewsUse route controller method with Slim
I have a controller called CardController with various methods within it, however I need to pass some data for these methods via parameter. Currently I can only access the methods directly as the…
-
1
votes2
answers1849
viewsSlimframework: Method not allowed. Must be one of: GET
I’m having a hard time solving a mistake that’s been slim framework. I have a contact page that is accessed /p/contact, after accessing and clicking the send button, it tries to send the…
-
1
votes0
answers318
viewsSlim return on the same page of a POST submission
I’m sending a request post to a URL, but I need to return to the same page a message or alert saying if the ID is already registered or not. I already have the query and method to do this, but I am…
-
1
votes0
answers327
viewsSlim Class Controller not found
I’m trying to make a model in MVC here, using some controllers. Follow my directories: Root/ app/ Controller/ Padrao.php public/ index php. Composer.json My file index php. (Yes, leaving td mixed,…
-
1
votes2
answers401
viewsProblem with json slim framework
I am making an api to do the integration of two different systems, the system sends me the following json: cJson = [{"TESTE": "1"}] I spent 3 days with a problem because I was not able to catch the…
-
1
votes0
answers66
viewsError on Function get() on null server
The server log reported the following error: Notice: Undefined variable: app in C: xxxx api v1 routers Schedule.php on line 28 Fatal error: Call to a Member Function get() on null in…
-
1
votes1
answer239
viewsGood Practice in APIS Rest Full with PHP and Doctrine ORM 2
Currently we have a system that uses Doctrine ORM2, we have our Entities, and themes our DAOS, within our DAOS classes we have several methods that we use to make queries, Change, Insert and Delete…
-
1
votes1
answer1700
viewsRoutes with slim PHP framework
Good afternoon, I have almost no experience with slim framework and am giving a studied by book. I downloaded via Composer and installed version 3.8 and had some differences. I tried to create a…
-
1
votes0
answers267
viewsSlim API returns error only with AJAX request
Hello, I developed an API using the Slim Framework and testing one of the endpoints that with Postman works perfectly but when I request with AJAX, although it is sending exactly the same data that…
-
1
votes1
answer124
viewsKeep id and id_user equal on updateOrCreate
Hi, using the Slim Framework for php, I’m trying to make a updateOrCreate: $eventos = Eventos::updateOrCreate( ["id" => $id, "id_usuario" => $id_usuario], ["nome" => $nome, "descricao"…
-
1
votes1
answer126
viewsfailed url rewrite slim iis 10
I’m trying to follow the slim tutorial here, but always give page not found when localhost:8080/hello/Alan access. I’m using iis 10. I installed rewrite url 2.0, and my web.config looks like this:…
-
1
votes0
answers81
viewsCurl inside another Url to save images
I have an api in Slim Framework, within the "Service A" of the api I am using a Curl to call the "Service B" of the api, this "Service B" downloads images by their url using another Curl, it runs…
-
1
votes1
answer57
viewsHelp with PHP session
Good morning! I have a php system where I use a webservice to perform queries, and save your return in the session to use via ajax. So far so good, the problem is when I need to make two or more…
-
1
votes0
answers78
viewsUsing Phpmailer and Ajax with Slim Framework
I’m a beginner in PHP and I need to treat a post route using Ajax, Slim and Phpmailer. In my index where you have the form I am using this jquery code for Ajax request: <script> $(function ()…
-
1
votes1
answer1073
viewsSlim Framework 4 with Eloquent ORM
I am using the Slim-Framework in version 4 for api creation and would like to use together Eloquent to facilitate manipulation with the database. But I couldn’t find any material/example of how to…
-
1
votes0
answers61
viewsSemantical Error The Annotation "@Symfony Component Validator Constraints Notblank " in Property was Never Imported
I am developing a simple API with Microframework Slim using Doctrine, I decided to implement some validations, so I installed the library symfony/validator:^5.2. In my entities, I have some Doctrine…
-
0
votes1
answer63
viewsRestkit performance with Afnetworking
I built a restserver using the Slim Framework (PHP), connecting in a Mysql BD. Is on a dedicated server and moderate performance, IE the response is very fast. But I made a test app on IOS where I…
-
0
votes1
answer635
viewsRedirect Rest service with . htaccess
I have a folder in my project called api, and within it a file .htaccess that should redirect the requests (made via jquery) to the folder app/controllers/rest/ which also has a file .htaccess and a…
-
0
votes1
answer34
viewsRoute with the character "."
Personal need to create a route in which a parameter of it is a filename with the extension. How do I create this one? Ex. http://localhost:8080/download/.pdf file I created so but error because of…
slimasked 8 years, 11 months ago Joao Nivaldo 1,229 -
0
votes1
answer909
viewsFind parameter with Slim Framework 3
I need help to get the parameter id the moment the URI is called, passing the same to the container. Follow the code below: $this->get('/{id}', function($request, $response, $args) { return…
-
0
votes0
answers390
viewsSlim 3 Framework - hosted in subdirectory
I have an api hosted on the local development machine in the following directory: root/www/api/v2 If I access by serving by apache, my routes are not recognized, not even if I access by…
-
0
votes1
answer709
viewsSlim Framework - DELETE and Framework Function
I’m having problems with slim DELETE, it shows a 404 error, follow the code: <?php require '../Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $app = new \Slim\Slim();…
-
0
votes1
answer287
viewsRest Web Service using Slim Framework, in PHP, always gives error when called by an Ajax method, although it runs?
I implemented a WS Rest in PHP, but when I try to consume WS using an Ajax method it always returns the error function. However the WS is saved and the data is even recorded in the BD. Someone has…
-
0
votes0
answers85
viewsAJAX with Slim Frame
Project : https://github.com/noebezerra/survey-slim I have a problem with the AJAX request ( Resources/views/templates/app.Twig ) ajax - app.Twig $('.stars-default').click(function(e) {…
-
0
votes1
answer249
viewsPrint a session variable via the Twig engine
I entered a variable in the designated session $_SESSION['ano']. I would like to print your value on a page using Twig. I’ve tried to: {% for ano in app.session %} {{ ano }} {% endfor %} But it…
-
0
votes2
answers298
viewsError installing Slim framework
How to fix the error below by using Composer. Code of Composer.json already created in bin folder\ : { "require": { "slim/slim": "2.*" } }…
-
0
votes1
answer61
viewsSlim Framework with Apache2.4
Good morning. I am creating an API to provide a service for other applications. I have the following scenario. A system to provide the service. This system has a virtualhost configured. The Uri is…
-
0
votes0
answers374
viewsProblems with CORS in application using API with Slim framework and Angularjs
Good afternoon friends I’m having trouble solving a problem Requisição cross-origin bloqueada: A política de mesma origem (Same Origin Policy) impede a leitura do recurso remoto em…
-
0
votes1
answer301
viewsSlimframework + PHP-View
I did the download library Php-View to use together with Slim Framework 3.x, but I am not able to make the return of view. // Get container $container = $app->getContainer(); // Register…