I’m generating a huge amount of data fixtures using the awesome Faker Library, also using lorempixel.com to have some random images in my Symfony2 project. This takes some time (currently ~ 10 Minutes), so I was wondering if it is possible to access the Command OutputInterface somehow through the contai…
Rename URL in Codeigniter
I want to remove /public/index.php from my Codeigniter and Bonfire project URLs.. My current URL: http://localhost/public/index.php/page Desired URL: http://localhost/page but I want the paths for …
How can I restrict some special characters only in PHP?
I am using preg_match for restrict the special characters in form post. Now I need to restrict some special characters only like %,$,#,* and I need to post like bé. How to possible to restrict some …
Installing Composer OpenSSL Issue
I am trying to install composer however when I go to install it I get this error: I currently have php 5.4.31 and I am running WAMP2.2 I’ve checked my php.ini file in the bin/php/php5.4.31/ and ensured that the following line is uncommented: The error still resolves and I’m at a loss as to how I c…
Zend redirect to controller if action not exist
For example I have action example.com/books/list But I made mistake and write example.com/books/lists, action lists not exist, how to redirect to controller/index if action not exist. To check before go to action I can use preDispatch(), but how to check do this action exist ? Answer Here is a function to che…
Laravel unit testing emails
My system sends a couple of important emails. What is the best way to unit test that? I see you can put it in pretend mode and it goes in the log. Is there something to check that?
Zend framework ‘Method “init” does not exist
When I submit POST I get Fatal error: I try to disable layout with: But also get same Fatal error. I get an error in this line : Where can be problem in my aplication ? Answer I think the error comes from the adapter you’re using. If you’re athenticating the user via a database table, I suggest yo…
MySQL automatically updating field when inserting data
I’m making a web application to make customers order items for anything. For that I’ve made a MySQL database which has the following tables: customers orders orders-items products In the customers table is all the information about the person such as: The customer ID, for the primary key and auto …
Check if Facebook user is logged in to app with PHP SDK
I have an app using the Facebook Login API. I take the details of the user and store it in my own database and create my own user id for the user (I also store the facebook id). Next time the user visits my site, I want to automatically set the session, without having them reconnecting again. So I want
How to give custom field name in laravel form validation error message
I was trying form validation in laravel. I have a input text field in my form called ‘Category’ and i’m given the field name as ‘cat’ as short. And i defined the validation rules like this. When the validation fails i’m getting error message like this But i want to display …