I have select HTML tag generated by this code: I would need to add an HTML attribute (e.g. inline style) to each option tag. Can you give me a hint, please? Answer You can use options
Chmod 640 for uploaded file after SUPEE 7405 patch
After installing the SUPEE 7405 patch, we noticed a problem uploading images from the admin. All file permissions are being set to CHMOD 640 which makes them inaccessible to all users. Is there a solution that does not involve rewriting the /lib/Varien/File/Uploader.php file? Answer A new version of SUPEE-740…
SQL BETWEEN Two Columns in Laravel/Lumen
Below is an excerpt from the Laravel documentation: The whereBetween method verifies that a column’s value is between two values: $users = DB::table(‘users’)->whereBetween(‘votes’, [1, 100])->…
Create an artisan command for generating custom classes or files
What’s the best way ( or maybe the way it’s actually done ) of creating an artisan command for generating custom classes or files? Like php artisan make:console itself that creates a php class for our …
How to use strpos($_SERVER[‘REQUEST_URI’] to generate active classes from url segments
We’ve found a lot of answers for this but don’t fully understand them (or the strpos manual page) so sorry if this is already answered. Setup: Consider the following urls… http://www.domain.com/…
How can I easily switch between PHP versions on Mac OSX?
I would like to test my application on PHP 5.3 up to PHP 7.0. Where and how can I install the versions and how can I switch them by running a small script? Answer If you have both versions of PHP installed, you can switch between versions using the link and unlink brew commands. For example, to switch between…
Fatal error: Class CI_Session_files_driver contains 1 abstract method
Fatal error: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::open) in C:xampp…
View pdf file in browser instead of downloading
header(“Content-Length: ” . filesize (‘theme/assets/pdf/ci.pdf’ ) ); header(“Content-type: application/pdf”); header(“Content-disposition: attachment; filename=”.basename(‘theme/assets/pdf/ci….
How to use a Function of Switch/Case, if at all?
I have various products inside a database, each has its own price, the pattern to output a product price is: $product[i][“price”] I also have various “product types”, which are manually defined in my code, each with index number that will relate to each product accordingly: I want to e…
How can I sanitize laravel Request inputs?
I have MyRequest.php class extending AppHttpRequestsRequest. I want to trim() every input before validation because an e-mail with a space after it does not pass validation. However sanitize() was …