Hi Nate, thanks for your answer, but doesn't work, maybe I don't
explain
the case correctly.

First of all I made a controller that returns a unique timestamp:

<?php
class TimeComponent extends Object
{

  function uniqueTimeStamp(){
    $Asec  = explode(" ", microtime());
    $Amicro = explode(".", $Asec[0]);
    return ($Asec[1].substr($Amicro[1], 0, 3));
  }

}
?>

Then, in my UserController I call it with:

$this->set('uniqueID', $this->Time->uniqueTimeStamp());

and in my add.thtml view I can use it with:

<?php echo $uniqueID; ?>

At this point everything is all right.

In my UserController I have the add method:


  function add()
  {
    $this->set('uniqueID', $this->Time->uniqueTimeStamp());


    if (empty($this->params['data']))
    {
      $this->render();
    }
    else
    {
      if ($this->User->save($this->params['data']))
      {
        $this->flash('User has been saved.','/users');
      }
    }
  }


The add methods save the input data entered by the user
on the input textboxes:

Ex:
<?php echo $html->input('User/username', array('size' => '20',
'maxlength'=>'20'))?>
<?php echo $html->input('User/password', array('size' => '15',
'maxlength'=>'15'))?>

But the returned $uniqueId is not saved with them.

How can I make this?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to