It has been long time for using opendir, readdir functions or even scandir for reading directory listing from the disk. Even myself still using it when in need.
Its time to update your snipped library with new PHP5 object oriented code. This is definitely not a new new thing, but still I want to make an article on it to attract more users to use this feature.
Quite often pages are overloaded with 3rd party APIs or widgets and page loading time becomes a bottleneck in user experience. In my project I need google maps support, but only if user selects one particular tab.
So how to load Google Maps V3 dynamicly, on button click or tab select
Recently I took part in integration project and faced interesting problem. PHP application that I deploy must communicate with Informix database for data selecte. This php application aims to corporate market, so its not a extraordinary case. I see that it may require connecto to Oracle or DB2 in near future.
Yes, PHP itself has wide choose of database connectors, which is a good option to have native database support. The only problem is that most of them are used so rare that are usualy not compiled in all modern Linux destributos. For example in Ubuntu server 12.04 there are five most pupular php5-sybase php5-interbase php5-mssql php5-mysql php5-pgsql.
Thinking of it, I found one interesting solution.
This is advertising post
Forms, forms, forms... This is essential part of the Web and probably main reason why servers-side technology like Perl, PHP appeared. But things didn't change much from the time I wrote my first Form handler using PHP3.0.18.
Big advantages is that it really simplifies things on client and server side. Welcome reading...
To be clear what I am talking about see the image below. It has nice Settings link which leads to plugin settings from plugin list.
Why I think this is important? Usually plugin creates new submenu in Settings, but sometimes it uses different name and it is not easy to find one. In case 20+ plugins are installed, which is a real case, it is not easy to remember where all these settings are stored.
I consider Settings link as a must have thing when developing plugin and its pretty easy to add it, see below
Its right from UI design point of view to show user some kind of progress in case site or application is busy with some internal processing. Especially with AJAX requests, because they take time!
In jQuery its very easy to hook all AJAX requests into one start/stop functions, so there is no need to show and hide progress indicator on each $.ajax request.
CodeIgniter is great framework by its simplicity. But when I moved from CakePHP, I really missed layout pattern.
CodeIgniter documentations offers this way to include non-changing site header and footer
$this->load->view('header'); $this->load->view('template'); $this->load->view('footer');
For sure it isn't flexible and does not show page structure in a clear way. For many years I use layout pattern. Layout describes whole page as a template with blocks for header, menu, content, etc like on figure below. On page rendering these blocks are filled with data.
I found a small code snipped for CI and improved it. You are welcome to try!
Clustering markers on GoogleMap is a very useful think in case of thousands of markers displayed. It makes the map look nice and fancy, instead of marker mess. In my previous post I told how to use MarkerClusterer library.
Today I want to add some advanced techniq how to use different styles, in case there are several datasources available.
Quite often there is a need to parse HTML and extract some values from deep-deep nested tables or so. Most front solution is to use regular expressions but they sucks with nested tags. Other way is to use XPath, which performs much better here, but has not simple syntax to use.
Nowadays almost all PHP developers knows jQuery, which became like a standard in front-end development. Why not to use it for HTML parsing using familiar syntax.