Author Archives: Andrei
Prestashop custom fields in products admin section
Prestashop custom fields in products admin section I had to do this modification on an existing prestashop project few months ago and I had to add some custom fields in products admin section. In this tutorial I’ll try to show you how you create new product field in admin on product edit page (informations tab). Of course
Symfony2 service container
Introduction A big PHP aplication should be OOP written and should have a lot of objects. You can split them by functionality depending on what they do. Some of them are used for interaction with database, some of them are used to save information in files.This chapter is about a special PHP object in Symfony2
Drag and drop on mobile devices
Drag and drop on mobile devices I had a problem in the past with a draggable and droppable calendar with jQuery and ajax. When you add drag and drop to a web page using JavaScript, such as jQuery UI draggable and droppable, you obtain a problem. The dragging and dropping are intercepted by the phone
How to select all anchors with display block jquery
How to select all anchors with display block jquery Very often or not, you need to select all the elements from within the DOM, that have their display property set to “block”. Solution
|
1 2 3 |
$('a').filter(function (index) { return $(this).css("display") === "block"; }) |
Filter function from jQuery to the rescue. Description: Reduce the set of matched elements to those that match the selector or pass
PHP Smarty var_dump alternative and prestashop errors
PHP Smarty var_dump alternative and prestashop errors If you work on prestashop for example, and you want to make a debug for all or a certain variable from within a page you will have problems because you cannot use var_dump since Smarty is a templating language for PHP. Method 1
|
1 2 3 4 5 6 7 |
{php} $var = $this->get_template_vars('var'); var_dump($var); {/php} |
Method 2
|
1 |
{$var|@print_r} |
Method
Disable jqueryui calendar days EXCEPT the mondays of every week
Disable jqueryui calendar days EXCEPT the mondays of every week Let’s say you want the user to be able to see all days from within the month, but to be able to select only the mondays of every week.
|
1 2 3 4 5 6 |
$("#datepicker").datepicker({ beforeShowDay: function (date) { var day = date.getDay(); return [(day == 1)]; } }); |
Here is a DEMO. You can disable all “Sundays” by switching from “day == 1”
Working with Entities in Symfony2
Working with Entities in Symfony2 Symfony is a very powerfull PHP framework that helps you do amazing projects in small amount of time. It has built in support for Doctrine which is an incredible tool for interacting with databases, not through tables but through php objects. First let’s see what is an ORM and after that







