Quantcast
Channel: A typical Developer Blog » snippet
Browsing latest articles
Browse All 7 View Live

How can i unit test my own User class functions?

Use this in your testcode to create the user object 1 2 3 4 5 6 7 8 $_SERVER['session_id'] = 'test';   $dispatcher = new sfEventDispatcher(); $sessionPath =...

View Article



How can i mark all required form fields with a *?

create file lib/gfFormHerlp.class.php 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 <?php   /** * Some usefull form helper * * @package symfony *...

View Article

How can i deactivate all checkboxes on a website with javascript?

1 2 3 4 5 6 7 8 inputs = document.getElementsByTagName('input'); for(i=0; inputs.length > i;i++) { if(inputs[i].type == 'checkbox') { inputs[i].checked= false; } } No related posts.

View Article

How can i call a symfony event from doctrine model?

1 2 $dispatcher = sfProjectConfiguration::getActive()->getEventDispatcher(); $dispatcher->notify($event); No related posts.

View Article

How can i check the count of database queries in my unit test?

1 2 3 $manager = new sfDatabaseManager($configuration); $connection = $manager->getDatabase('doctrine')->getDoctrineConnection(); $connection->count(); No related posts.

View Article


How can i use embed forms or simgle form fields depend on a form field?

You have a register form with a field account_type and two embed forms Company and Address. You want remove the embed Company form, when the field account_type is sfGuardUserProfile::TYPE_PRIVATE...

View Article

How can i run multiple instances of memcached on one server?

Problem I need more then one memcached server. Solution Virtual machine I can build for each memcached server a virtal machine. Problems more memory (system+memcached) one ip address for each instance...

View Article
Browsing latest articles
Browse All 7 View Live




Latest Images