Skip to main content

Posts

Showing posts from July, 2014

Drupal7 add more AJAX Form example . [How to use Drupal AJAX form for multiple fields with add more concept?]

The following code you can use it in either your form alter (form_id alter) or your custom form functions...... function modulename_add_more_form() {     $form['description'] = array(     '#markup' => '<div>This is an example of a AJAX Form, where we can use AJAX add more concept in drupal for a set of fields.</div>',   );   // Because we have many fields with the same values, we have to set   // #tree to be able to access them.   $form['#tree'] = TRUE;   $form['names_fieldset'] = array(     '#type' => 'fieldset',     '#title' => t('Family member details'),     // Set up the wrapper so that AJAX will be able to replace the fieldset.     '#prefix' => '<div id="names-fieldset-wrapper">',     '#suffix' => '</div>',   );   // Build the fieldset with the proper number of names. We'll use   // $form_state['num_na

Ctools multi step form example Drupal 7

File name:-   multi_example.module  <?php /**  * @file  * Example module for ctools miltistep form wizard.  *  * Example module which demonstrates the power of ctools multistep wizard.  */ /**  * Implements hook_menu().  */ function multi_example_menu() {   $items['example/%ctools_js/form'] = array(     'title' => 'Example form',     'page callback' => 'multi_example_form',     'page arguments' => array(1),     'access callback' => TRUE,     'type' => MENU_CALLBACK,   );   $items['example-link'] = array(     'title' => 'Example form link',     'page callback' => 'multi_example_link',     'page arguments' => array(1),     'access callback' => TRUE,     'type' => MENU_CALLBACK,   );   return $items; } /**  * Page callback: Dispalys example links.  *  * @return array  *   A render array for d

Basic steps to Symfony2 php framework (Beginers guide symfony2)

INSTALLATION : Download and unzip the file to your WEB_ROOT folder [ http://symfony.com/download ] . Give the permision Create a database for the Symfony instance . Open Browser and go to  http://localhost/Symfony/web/app_dev.php Navigate to 'CONFIGURE' or  http://localhost/Symfony/web/app_dev.php/_configurator/step/0  for configuring the database with your symfony instance.  Please copy the ' Secret  * '  Key and paste in the "/app/config/parameters.yml" Note:-  $ is you should go to your WEB_ROOT/Symfony/ in terminal and run CREATE BUNDLE:          $ php app/console generate:bundle --namespace=July/TestBundle                   Bundle name [JulyTestBundle]: JulyTestBundle                  Target directory [/opt/lampp/htdocs/Symfony/src]                  Configuration format (yml, xml, php, or annotation): yml CREATE ENTITY : $ php app/console generate:doctrine:entity --entity=JulyTestBundle:Task   The Entity shor