Skip to main content

Home/ foograde/ Group items tagged M:M

Rss Feed Group items tagged

Adán Muguiro

Doctrine NestedSet - 0 views

  • $treeObject = Doctrine_Core::getTable('Category')->getTree(); $rootColumnName = $treeObject->getAttribute('rootColumnName'); foreach ($treeObject->fetchRoots() as $root) { $options = array( 'root_id' => $root->$rootColumnName ); foreach($treeObject->fetchTree($options) as $node) { echo str_repeat(' ', $node['level']) . $node['name'] . "\n"; } }
    • Fernando Vega
       
      fetch para deplegar nodos padres e hijos con doctrine
  • First lets create the query we want to use to retrieve our tree data with: // test.php // ... $q = Doctrine_Query::create() ->select('c.name, p.name, m.name') ->from('Category c') ->leftJoin('c.HottestProduct p') ->leftJoin('p.Manufacturer m'); Now we need to set the above query as the base query for the tree: $treeObject = Doctrine_Core::getTable('Category')->getTree(); $treeObject->setBaseQuery($q); $tree = $treeObject->fetchTree(); There it is, the tree with all the related data you need, all in one query.
  •  
    Agregar una subconsulta a un objeto NestedSet
Adán Muguiro

Modificando los widgets en la acción - 0 views

  • // in modules/foo/actions/actions.class.php // Define the form $this->form = new ContactForm();   // Add an empty option to the list of choices of a 'choice' widget $form->getWidget('language')->setOption('add_empty', 'Please choose a language'); // Add a 'gender' list of options widget $form->setWidget('gender', new sfWidgetFormChoice(array('expanded' => true, 'choices' => array('m' => 'Male', 'f' => 'Female')), array('class' => 'gender_list'))); // Change the HTML attributes of the 'subject' widget $form->getWidget('subject')->setAttribute('disabled', 'disabled'); // Remove the 'subject' field unset($form['subject']) // Note: You cannot remove just the widget. Removing a widget will also remove the related validators   // Change the 'min_length' error in the 'message' validator $form->getValidator('message')->setMessage('min_length', 'Message too short'); // Make the 'name' field optional $form->getValidator('name')->setOption('required', false);
  •  
    Varias cosas que se pueden modificar en los widgets desde la acción.
Adán Muguiro

Modificar template de los widgets - 0 views

  • $this->getWidgetSchema()->getFormFormatter()->setRowFormat('<div >%field%%help%%error%%hidden_fields%</div>');
  •  
    En caso de no querer poner los labels o cualquier otro componente de un widget por default.
Adán Muguiro

sfWidgetFormPropelChoice y el valor seleccionado - 0 views

  • in BaseFormPropel i have the function : public function setValue($field,$value){ $this->widgetSchema[$field]->setDefault ($value); } and in my action : $this->form->setValue('idtype_doc',$this->getUser()->getAttribute('dossier_rec[type_doc]'));
  •  
    Cómo modificar el valor seleccionado dentro de un select de propel o cualquier otro.
Adán Muguiro

Campos i18n en Admin Generator - 0 views

  • //generator.yml form: display: Espanol: [es] Italiano: [it] fijos: [forma_pago, moneda_code]
  •  
    Agregar campos i18n en una personalización del Admin Generator de una tabla
Fernando Vega

symfony framework forum: symfony 1.3 and 1.4 => is there anyone can tell me how to use ... - 0 views

  • in the form $this->widgetSchema['login_id'] = new sfWidgetFormJQueryAutocompleter(array( 'url' => '/ajax/getUser', )); and in the action of executeGetUser $this->getResponse()->setContentType('application/json'); $users=Doctrine::getTable('user')->getLoginIDList(); return $this->renderText(json_encode($users)); And in the userTable which inside Doctrine $q=Doctrine_Query::create()->select('login_id')->from('user')- >execute(); foreach($q as $row){ $login_id[$row->login_id]=$row->login_id; } return $login_id; hope this help =]
    • Fernando Vega
       
      autocompletar con doctrine y sf 1.4
Fernando Vega

Alternativo layout por accion - 0 views

  • Just use $this->setLayout('popup') in your action or use in the view.yml of your module: actionSuccess: layout: popup
  •  
    layout diferentes por accion, util para peticiones de ajax por iframes
Adán Muguiro

sfWidgetFormJQueryAutocompleter - 2 views

  •  
    Utilizando el widget de autocompletado
1 - 8 of 8
Showing 20 items per page