I'm a little frustrated because i have a problem invoking de $html-
>tagErrorMsg on one of my views.
As a resume i present the next files:
*********************************
View: add_admin.thtml
********************************
<?php echo $html->formTag('addAdmin','post'); ?>
<p>
Usuario:
<?php echo $html->input('User/username', array('size' => '40'))?
>
<?php echo $html->tagErrorMsg('User/username','Wrong value'') ?
>
</p>
<p>
password:
<?php echo $html->input('User/accesskey', array('size' =>
'40')) ?>
<?php echo $html->tagErrorMsg('User/accesskey','Wrong value.') ?
>
</p>
<p>
<?php echo $html->submit('Save') ?>
</p>
</form>
*************************************************
Controllers: administrators_controller.php
************************************************
class AdministratorsController extends AppController{
function addAdmin{
if(!empty($this->data['User'])){
$this->requestAction("/users/add");
}
}
}
*******************************************
Controllers: users_controller.php
******************************************
class UsersController extends AppController{
function add(){
$validate=!$this->User->save($this->data['User'])?$this->User-
>invalidFields():true;
}
}
********************************************
Model: user.php
*****************************************
class User extends AppModel{
var $name = "User";
var $validate = array('username' => '/[a-z0-9]{1,}$/i',
'accesskey'=> '/[a-z0-9]{1,}$/i'
);
}
So, everything is fine to me, but when i introduce a wrong value in
the input tag...and if i
print the return value from UsersController::add i get this: Array
( [username] => 1 [accesskey] => 1 )
But the messages are not displayed on the view, I would be grateful if
anyone can help me or give some insight
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---