Skip to main content

Home/ foograde/ Group items tagged functional

Rss Feed Group items tagged

Fernando Vega

symfony framework forum: symfony 1.3 and 1.4 => Admin generator, filters and I18n - 1 views

  •  
    "class MenuFormFilter extends BaseMenuFormFilter { private $rootAlias; public function configure() { $this->widgetSchema['title'] = new sfWidgetFormFilterInput(array('with_empty' => false)); $this->validatorSchema['title'] = new sfValidatorPass(array('required' => false)); $this->widgetSchema['type'] = new sfWidgetFormChoice(array( 'choices' => Doctrine_Core::getTable('Menu')->getTypes(), 'expanded' => false, )); $this->validatorSchema['type'] = new sfValidatorChoice(array( 'choices' => array_keys(Doctrine_Core::getTable('Menu')->getTypes()), )); } public function addTitleColumnQuery(Doctrine_Query $q, $field, $values) { if (is_array($values) && isset($values['text']) && '' != $values['text']) { $this->JoinTable($q); $q->andWhere('t.title like ?', '%' . str_replace(" ","%",$values['text']) . '%'); } } public function addTypeColumnQuery(Doctrine_Query $q, $field, $values){ if (isset($values) && '%' != $values) { $this->JoinTable($q); $q->andWhere('t.type = ?', $values); } } private function JoinTable(Doctrine_Query $q){ if(empty($this->rootAlias)){ $request = sfContext::getInstance()->getRequest(); $this->rootAlias = $q->getRootAlias(); $q->leftJoin($this->rootAlias.'.Translation t') ->andWhere('t.lang = ?', $request->getParameter('sf_culture', 'ro')); // or it will search in all of them } } public function getFields(){ return parent::getFields() + array('type' => 'Text') + array('title' => 'Text'); } } "
federico balderas

PHP: copy - Manual - 0 views

  •  
    "Here's a simple recursive function to copy entire directories Note to do your own check to make sure the directory exists that you first call it on. "
  •  
    mover carpeta con todos sus archivos en php
federico balderas

PHP: rmdir - Manual - 0 views

  •  
    "Here's another version of the recursive directory removal. This version requires PHP 5, and returns TRUE on success or FALSE on failure. "
  •  
    borra una carpeta del servidor con todo y sus subcarpetas y archivos
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

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

Incluir formularo i18n en un modelo - 1 views

  • public function configure() { unset( $this['jobeet_affiliates_list'], $this['created_at'], $this['updated_at'] );   $this->embedI18n(array('en', 'fr')); $this->widgetSchema->setLabel('en', 'English'); $this->widgetSchema->setLabel('fr', 'French'); }
  •  
    Codigo a pegar en el TablaForm de cierto modelo
federico balderas

Symfony - Delete and reload all database records for each test - Stack Overflow - 0 views

  •  
    "$doctrine = new sfDoctrineDropDbTask($configuration->getEventDispatcher(), new sfAnsiColorFormatter()); $doctrine->run(array(), array("--no-confirmation","--env=test")); $doctrine = new sfDoctrineBuildDbTask($configuration->getEventDispatcher(), new sfAnsiColorFormatter()); $doctrine->run(array(), array("--env=test")); $doctrine = new sfDoctrineInsertSqlTask($configuration->getEventDispatcher(), new sfAnsiColorFormatter()); $doctrine->run(array(), array("--env=test"));"
Fernando Vega

Crear minuaturas por medio de una ruta - 1 views

public function configure() { $file_src = sfContext::getInstance()->getController()->genUrl(array( 'sf_route' => 'sf_image', 'format' => 'backend_edit', 'filepath' => '/ba...

started by Fernando Vega on 20 Oct 10 no follow-up yet
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

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

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
Fernando Vega

Copiar imagen de un servidor a otro. - Foros del Web - 0 views

  • function recibe_imagen ($url_origen,$archivo_destino){  $mi_curl = curl_init ($url_origen);  $fs_archivo = fopen ($archivo_destino, "w");  curl_setopt ($mi_curl, CURLOPT_FILE, $fs_archivo);  curl_setopt ($mi_curl, CURLOPT_HEADER, 0);  curl_exec ($mi_curl);  curl_close ($mi_curl);  fclose ($fs_archivo);  } 
    • Fernando Vega
       
      Guardar imagenes de Google Chart URL GET
1 - 12 of 12
Showing 20 items per page