Archive: page 14
Attaching the population filter without using form IDs (suitable where the current form is on the same page as the URL in forms action parameter) <?php // Like so $this->getContext()->getRequest()->setAttribute('populate', new AgaviParameterHolder(array( 'question[0]' => 'Can you eat cheese?', 'answer[0]' => 'No' )), 'org.agavi.filter.FormPopulationFilter'); // Or like so... $populate =& $this->getContext()->getRequest()->getAttribute('populate', 'org.agavi.filter.FormPopulationFilter'); $populate = new AgaviParameterHolder(array( 'question[0]' => 'Can you eat cheese?', 'answer[0]' => 'No' )); Use form ids to link the pre-population to a particular form Read more ⇒
To get Netbeans to listen for browser initiated debug sessions please consider the following steps: Go to Project Properties > Run Configuration > Advanced > Debug URL and choose the Do not open a web browser. Save. (you may like to setup Path Mapping, but it works for me without it) In the projects listing right click on your intended project and choose Debug, which will start Netbeans listening for connections. Read more ⇒
Bitextender backed Agavi is a very secure and helpful open source (LGPL) MVC framework with the core development being headed by David Zülke (Wombert) and Felix Gilcher (certainly in the IRC channel!). It can take some time to get the hang of the framework so I have put together all the resources I use or have used to help you get started. Documentation Resources: Official Agavi Tutorial - Incomplete at time of writing API Documentation Agavi Cookbook Official Agavi FAQ Unofficial Agavi FAQ – Very helpful Package Docs in SVN – You need to dig around these folders in the SVN source code viewer of Trac (some of it is also old) Veikko Mäkinen’s Blog: http://blog. Read more ⇒
I worked on a project while ago that required the use of iFrames to create “AJAX” file uploads. It took me a little while but I finally worked out how to get the contents of an iFrame using jQuery. To get the contents of an iFrame we need to wait until the iFramed content has finished loading as well. var iFrameBody = ""; $("#iframe").load(function () { iFrameBody = $(this).contents().find("body"); }); Read more ⇒
Opera has released a new version of their free mobile browser Mini for beta testing. Head on over to mini.opera.com to download it or if you are reading this from your mobile the direct link to the beta is m.opera.com/next. The new version is much improved in many areas. The first thing you will notice is a new sleeker user interface and a “Speed Dial” interface when it first loads up. Read more ⇒
jQuery Using and Manipulating Select Lists
JQuery is a fantastic tool but sometimes its functionality can be obscure or doing it one way might not work in a certain browser (MSIE6 anybody!). I have often found myself trying to remember the best way to work with HTML select lists so I am compiling this list of hints for future use and I hope that you find it useful. All the examples below are written where this represents the select element of the select list. Read more ⇒
Moving to git and setting up InDefero as a web frontend
Most of our development is done on Vista desktops (although I also run Ubuntu of course) and we wanted a web interface for easy browsing of code so I needed to use a pervasive and well supported VCS. After much hunting around and looking at Bazaar, Mercurial and git I decided to go with the latter due to its support in the community. There are still some reservations I have against git, which work well for Linux kernal development but not our day to day web development – the major one being that subversion would allow you to commit and update on a file by file basis where as git versions the entire repository at once as far as I am aware. Read more ⇒
I use most of these commands every day to simplify my terminal interactions with an Ubuntu development box. This is more of a personal reference but thought I would share incase you find it useful. Task Command Get all users on the system for user in `getent passwd | cut -d: -f1`; do id $user; done Delete all .svn or any file name by replacing .svn in the command with your filename Read more ⇒
Samba File Share Over SSH Tunnel
This is not a post about setting up Samba shares. If that is what you are looking for then I can recommend the following book; Using Samba: A File & Print Server for Linux, Unix & Mac OS X. Sometimes you need to be able to access a remote Samba server in a secure manner from a Windows machine. This is a relatively simple procedure on an XP SP3 machine like mine linking into an Ubuntu server pre setup with Samba file sharing. Read more ⇒
Memcached and APC: Two Simple Techniques to Speed up your PHP Webpages
Memcached and APC are two tools that you can install on your server and gain almost instant gratification! APC basically caches executions that you send to a PHP process so that the next time you ask the parser to run your script it only has to look for some pre-chewed opcode in memory rather than parsing your PHP from the disk. APC also has another feature up its sleeve, memory object caching, which allows you to store objects such as results from a database table in memory. Read more ⇒