I’m using symfony 2.3 I have form with field of type “collection” Visualization code in twig: Everything work, expect when form.fields is empty. Then nothing is visualized in twig loop, witch is fine. But at the end of the form there is “label” for the element “form.fields&…
Tag: php
Equivalent of Alert() and Prompt() in PHP
In JavaScript, we have Alert() and Prompt() which open up a popup box for the user. Is there an equivalent for PHP? $Get_[‘asdf’] is one way to get user input… any others? Also, one more question. Is it a requirement that PHP always be executed all at once? Or can it be like JavaScript, wher…
How to make artisan serve work in virtual host?
I’m on Windows 8 and I’m using WAMP to run my laravel project. I have configured apache and I created a virtual host, to access my app through http://myapp.dev. I would like to know if it’s possible …
How to use groupBy() to group a Collection object
My goal is to retrieve all of a user’s ‘items’ and display then in my view grouped by their ‘status’. There are 4 possible statuses, each with their own <div> on the page containing the items’ info. After some poking around I believe I need to use the groupBy() method…
Lost data because of 301 error (POST)
I’ve a 301 error after doing my POST Form… When I submit my form, I lose all my data and I don’t know why. I search on the net but I don’t understand anything because my english is too bad to do it… My HTML code addSwitchPort.html : My PHP code addSwitchPort.php : This is the cod…
Convert Excel’s “41014” date to actual date in PHP or JavaScript
I’m writing something in PHP/Jquery that allows the user to upload an Excel spreadsheet from Excel. It then takes the data in that spreadsheet and assigns the values from each cell into a variable, but for some reason, I’m having a hard time with dates. Any date in Excel comes in as a number, like…
Redirect 302 on Laravel POST request
I’m developing a Laravel Web Service. When I try my POST routes with web forms, everything works fine, but when I try the same with a REST Client like Postman it doesn’t get me the response that should. It gives me status code 302, and redirects to “/”. What’s the problem? Answer…
Visually same string gives different var_dumps in php
UPDATE: Anwer is here PHP unserialize fails with non-encoded characters? I’m trying to match objects with in_array. This works fine except for the object with this string as a property. Visually they are the same, but when I do a var_dump PHP sees different lengths. var_dump results: What can be the cau…
How do I run PHP’s built-in web server in the background?
I’ve written a PHP CLI script that executes on a Continuous Integration environment. One of the things it does is it runs Protractor tests. My plan was to get the built-in PHP 5.4’s built-in web …
Check if value is empty javascript
After submitting I want the redirect the users to a different page with the value of the input in the url. Now, when there is no value I want that it does nothing (return false). How can I do this? …