Using 1.2
------------------------------------------------------------
In my index view:
------------------------------------------------------------
<?php
echo $form->create('formFind', array('url' => 'index'));
echo $form->input('find', array('value' => $findUrlNotCleaned, 'label'
=> 'Buscar', 'type' => 'text', 'id' => 'find', 'class' => 'input',
'size' => '30', 'maxlength' => '100'));
echo $form->end('Submit');
?>
------------------------------------------------------------
In my controller:
------------------------------------------------------------
function index() {
uses('sanitize');
$sanitize = new Sanitize();
$this->set('findUrlNotCleaned', trim($this->data['formFind']
['find']) );
$this->cleanData = $sanitize->clean( $this->data );
$findUrl = low( trim($this->cleanData['formFind']['find']) );
if ( $findUrl != '' ) {
$this->Benchlink->recursive = 0;
$this->set('benchlinks', $this->paginate('Benchlink',
array("LOWER(`Benchlink`.`url`) LIKE '%" . $findUrl . "%'")));
} else {
$this->Benchlink->recursive = 0;
$this->set('benchlinks', $this->paginate());
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---