Skip to main content

Home/ foograde/ Contents contributed and discussions participated by Adán Muguiro

Contents contributed and discussions participated by Adán Muguiro

Adán Muguiro

Configuración de Apache para un sitio con Symfony - 2 views

  • NameVirtualHost 127.0.0.1:8080 # This is the configuration for your project Listen 127.0.0.1:8080 <VirtualHost 127.0.0.1:8080> DocumentRoot "/home/sfproject/web" DirectoryIndex index.php <Directory "/home/sfproject/web"> AllowOverride All Allow from All </Directory> Alias /sf /home/sfproject/lib/vendor/symfony/data/web/sf <Directory "/home/sfproject/lib/vendor/symfony/data/web/sf"> AllowOverride All Allow from All </Directory> </VirtualHost>
  •  
    Lo que debería ir en /etc/apache2/httpd.conf
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

Widgets para fechas con i18n - 0 views

  • $w = new sfWidgetFormI18nDate(array( 'culture' => 'fr', 'month_format' => 'short_name', ));
  •  
    Para poner los meses abreviados con la nomenclatura en español
Adán Muguiro

Reteniendo el nombre original del archivo al subirse. - 0 views

  •  
    El sfValidatorFile modifica el nombre del archivo a un hash de números locos, si no queremos esto y conservar el nombre del archivo se puede leer esto.
Adán Muguiro

La Guia Definitiva Symfony 1.4 - 2 views

  •  
    Por fin ha salido, aunque sea en inglés por lo pronto
Adán Muguiro

Mover un archivo o directorio con PHP - 0 views

  • <?phprename("/tmp/archivo_tmp.txt", "/home/user/login/docs/mi_archivo.txt");?>
  •  
    Comando rename para mover directorios en PHP. Para lo de Birce.
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

Email y Symfony 1.4 - 0 views

  • $message = $this->getMailer()->compose( array('jobeet@example.com' => 'Jobeet Bot'), $affiliate->getEmail(), 'Jobeet affiliate token', <<<EOF Your Jobeet affiliate account has been activated.   Your token is {$affiliate->getToken()}.   The Jobeet Bot. EOF );   $this->getMailer()->send($message);
  •  
    Enviando un email simple con Symfony 1.4
Adán Muguiro

Embed Forms - 0 views

  •  
    Líneas de código para embeber un formulario dentro de otro donde existe una relación de clave foránea.
Adán Muguiro

Practical symfony | Día 3: El Modelo De Datos | symfony | Web PHP Framework - 0 views

  • php symfony doctrine:generate-module --with-show --non-verbose-templates frontend job JobeetJob
  •  
    Generando un módulo basado en una clase de Doctrine
Adán Muguiro

Git - DreamHost - 0 views

  • Setup One: For the Impatient If git is already working on your server (it was on mine), this will get you up and running ASAP. # Setup SSH keys [local ~]$ ssh-keygen -t rsa [local ~]$ ssh-copy-id [user@]host [local ~]$ eval `ssh-agent` [local ~]$ ssh-add # Create the local repository [local ~]$ cd project [local project]$ git init [local project]$ touch .gitignore [local project]$ git add . [local project]$ git commit # Create a bare remote repository [local project]$ ssh [user@]host [host ~]$ mkdir project.git [host ~]$ cd project.git [host project.git]$ git --bare init [host project.git]$ exit # Push to the remote repository [local project]$ git remote add origin ssh://[user@]host/~/project.git [local project]$ git push origin master [local project]$ git branch --set-upstream master origin/master # Clone from the remote repository [other ~]$ git clone ssh://[user@]host/~/project.git
  •  
    Configuración de Git en Dreamhost
Adán Muguiro

Chuletas (cheat sheet) para Symfony | Symfony.es - 0 views

  •  
    Las chuletas con Symfony
Adán Muguiro

The Definitive Guide to symfony | Chapter 7 - Inside The View Layer | symfony | Web PHP... - 0 views

  • <?php   class newsComponents extends sfComponents { public function executeHeadlines() { $c = new Criteria(); $c->addDescendingOrderByColumn(NewsPeer::PUBLISHED_AT); $c->setLimit(5); $this->news = NewsPeer::doSelect($c); } }
  • <div> <h1>Latest news</h1> <ul> <?php foreach($news as $headline): ?> <li> <?php echo $headline->getPublishedAt() ?> <?php echo link_to($headline->getTitle(),'news/show?id='.$headline->getId()) ?> </li> <?php endforeach ?> </ul> </div>
  • // Call to the component <?php include_component('news', 'headlines', array('foo' => 'bar')) ?>   // In the component itself echo $this->foo; => 'bar'   // In the _headlines.php partial echo $foo; => 'bar'
  •  
    Componentes en Symfony
Adán Muguiro

The Definitive Guide to symfony | Chapter 8 - Inside The Model Layer | symfony | Web PH... - 0 views

  • SQL Criteria WHERE column = value ->add(column, value); WHERE column <> value ->add(column, value, Criteria::NOT_EQUAL); Other Comparison Operators > , < Criteria::GREATER_THAN, Criteria::LESS_THAN >=, <= Criteria::GREATER_EQUAL, Criteria::LESS_EQUAL IS NULL, IS NOT NULL Criteria::ISNULL, Criteria::ISNOTNULL LIKE, ILIKE Criteria::LIKE, Criteria::ILIKE IN, NOT IN Criteria::IN, Criteria::NOT_IN Other SQL Keywords ORDER BY column ASC ->addAscendingOrderByColumn(column); ORDER BY column DESC ->addDescendingOrderByColumn(column); LIMIT limit ->setLimit(limit) OFFSET offset ->setOffset(offset) FROM table1, table2 WHERE table1.col1 = table2.col2 ->addJoin(col1, col2) FROM table1 LEFT JOIN table2 ON table1.col1 = table2.col2 ->addJoin(col1, col2, Criteria::LEFT_JOIN) FROM table1 RIGHT JOIN table2 ON table1.col1 = table2.col2 ->addJoin(col1, col2, Criteria::RIGHT_JOIN)
  •  
    Sentencias SQL y sus equivalentes con Criteria
Adán Muguiro

The Definitive Guide to symfony | Chapter 11 - Ajax Integration | symfony | Web PHP Fra... - 0 views

  • <div id="item_list"></div> <?php echo form_tag('@item_add_regular') ?> <label for="item">Item:</label> <?php echo input_tag('item') ?> <?php if_javascript(); ?> <?php echo submit_to_remote('ajax_submit', 'Add in Ajax', array( 'update' => 'item_list', 'url' => '@item_add', )) ?> <?php end_if_javascript(); ?> <noscript> <?php echo submit_tag('Add') ?> </noscript> </form>
  • <div id="feedback"></div> <div id="indicator" style="display: none">Loading...</div> <?php echo link_to_remote('Delete this post', array( 'update' => 'feedback', 'url' => 'post/delete?id='.$post->getId(), 'loading' => visual_effect('appear', 'indicator'), 'complete' => visual_effect('fade', 'indicator'). visual_effect('highlight', 'feedback'), )) ?>
  • <div id="feedback"></div> <div id="indicator">Loading...</div> <?php echo link_to_remote('Delete this post', array( 'update' => 'feedback', 'url' => 'post/delete?id='.$post->getId(), 'loading' => "Element.show('indicator')", 'complete' => "Element.hide('indicator')", )) ?>
  •  
    Formulario que funciona con Ajax o no
Adán Muguiro

Easy Ajax in symfony | symfony | Web PHP Framework - 0 views

  • <?php foreach ($sf_user->getAttribute('cart') as $product_id => $quantity): ?> <div> <?php for ($i = 1; $i <= $quantity; $i++): ?> <?php echo image_tag('product'.$product_id, array( 'class' => 'cart-items', 'id' => 'item_'.$product_id.'_'.$i, 'style' => 'position:relative' )) ?> <?php endfor; ?> (<?php echo $quantity ?> <?php echo $products[$product_id] ?>) </div> <?php endforeach; ?>   <?php if (!$sf_user->getAttribute('cart')): ?> nothing yet in your shopping cart. <?php endif; ?>
  • public function executeAdd() { $tmp = split('_', $this->getRequestParameter('id', '')); $product_id = $tmp[1];   $cart = $this->getUser()->getAttribute('cart'); if (!isset($cart[$product_id])) { $cart[$product_id] = 1; } else { ++$cart[$product_id]; } $this->getUser()->setAttribute('cart', $cart); $this->products = $this->getProducts(); }
  •  
    Variables de usuario e imágenes en Symfony
Adán Muguiro

Ejemplo básico Google Maps API v3 - 1 views

  • <html><head><meta name="viewport" content="initial-scale=1.0, user-scalable=no" /><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=set_to_true_or_false"></script><script type="text/javascript">  function initialize() {    var latlng = new google.maps.LatLng(-34.397, 150.644);    var myOptions = {      zoom: 8,      center: latlng,      mapTypeId: google.maps.MapTypeId.ROADMAP    };    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);  }</script></head><body onload="initialize()">  <div id="map_canvas" style="width:100%; height:100%"></div></body></html>
  •  
    El clásico Hola, Mundo!
Adán Muguiro

jq_input_auto_complete_tag - 1 views

  • <?php echo jq_input_auto_complete_tag('servicio''','servicios/ buscarServicio',array('class'=>'fs11'),array('use_style'=> true,'autocomplete' =>...)) ?> En la acción, el parámentro no se recoge mediante "$request- >getParameter('servicio')" sino mediante "$request->getParameter ('q')".
  •  
    Autocompletado con AJAX y Symfony
  •  
    Autocompletado con AJAX y Symfony 1.4
‹ Previous 21 - 39 of 39
Showing 20 items per page