I need help on this topic.i have follow up The Cookbook manual help
regarding this.But there is no output.
############### registartion.ctp ########################
Here i want localization
<div class="content-section">
<div class="full-area">
<div class="main-head"><?php __('registrationForm'); ?></div>
<!--start content section-->
<?php
echo $form->create( 'Users', array('action' =>
'add_user','name'=>'frmAddUser','id'=>'frmAddUser','type' => 'file'));
echo $form->hidden('User.reg_date', array( 'value' => time()));
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">First Name</td>
<td width="71%" align="left"
class="bg_white">
<?php echo
$form->text('User.fname', array('class'=>'input-
box-reg'));?>
<div id="errorFname" class="errorMsg"
style="display:none"></div>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">Last Name</td>
<td width="71%" align="left"
class="bg_white">
<?php echo $form->text('User.lname', array
('class'=>'input-box-reg'));?>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">Gender</td>
<td width="71%" align="left"
class="bg_white">
<?php
$optionsValue=array('F'=>'Female','M'=>'Male');
echo
$form->select('User.gender',$optionsValue)
?>
<div id="errorGender" class="errorMsg"
style="display:none"></div>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">Dob</td>
<td width="71%" align="left"
class="bg_white">
<?php
echo
$form->day('dobdate'); echo "\t".$form->select
('dobdate.month',$arryMonth); echo "\t".$form->year('dobdate',
1940,2009);
?>
<div id="errorDOB" class="errorMsg"
style="display:none"></div>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">Membership Type</td>
<td width="71%" align="left"
class="bg_white">
<?php
$optionsValue=array('1'=>'Basic','2'=>'Advance');
echo
$form->select('User.user_type',$optionsValue)
?>
<div id="errorType" class="errorMsg"
style="display:none"></div>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">Email</td>
<td width="71%" align="left"
class="bg_white">
<?php echo $form->text('User.email', array
('class'=>'textarea-manage'));?>
<div id="errorEmail" class="errorMsg"
style="display:none"></div>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">Password</td>
<td width="71%" align="left"
class="bg_white">
<?php echo $form->password('User.pass'); ?>
<div id="errorPass" class="errorMsg"
style="display:none"></div>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">Confirm Password</td>
<td width="71%" align="left"
class="bg_white">
<?php echo $form->password('User.cpass'); ?>
<div id="errorCpass" class="errorMsg"
style="display:none"></div>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">City</td>
<td width="71%" align="left"
class="bg_white">
<?= $form->select( 'User.city_id',
$arrayCity, null); ?>
<div id="errorCity" class="errorMsg"
style="display:none"></div>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">Occupation</td>
<td width="71%" align="left"
class="bg_white">
<?= $form->select( 'User.occupation_id',
$arrayOccupation, null); ?>
<div id="errorOccupation" class="errorMsg"
style="display:none"></div>
</td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">Hobbies</td>
<td width="71%" align="left"
class="bg_white">
<?= $form->select( 'UserHobby.hobby_id',
$arrayHobby, null, array( 'multiple' => 'checkbox' )); ?
> </td>
</tr>
<tr align="center" valign="middle">
<td width="29%" align="left" class="bg_white
label">About Me</td>
<td width="71%" align="left"
class="bg_white">
<?php echo $form->textarea('User.about_me',
array('class'=>'textarea-manage'));?> </td>
</
tr>
<tr align="center" valign="middle">
<td colspan="2">
<?php echo $form->submit('SAVE',array
('class'=>'button-1','name'=>'save_employer','onclick'=>'return
validateAddUser()')); ?>
</td>
</tr>
</table>
<?php echo $form->end(); ?>
</div><!--close content section-->
</div>
</div>
######### users_controller.php #####################
<?php
uses('L10n');
class UsersController extends AppController {
var $name = 'Users';
var $uses = array('User','City','Hobby','Occupation','UserHobby');
var $helpers = array('Html', 'Form', 'Javascript','Session');
var $paginate = array('limit' => 15);
function registration()
{
//$this->layout='admin_dashboard';
$this->L10n = new L10n();
echo $this->L10n->get("en");
$_SESSION['Config']['language'] = "eng";
Configure::write('Config.language', 'eng');
$this->set('valid', true);
$data = $this->City->find('list',array('fields' =>
array('City.id',
'City.city_name')));
$this->set('arrayCity', $data);
$data = $this->Occupation->find('list',array('fields' => array
('Occupation.id', 'Occupation.occupation')));
$this->set('arrayOccupation', $data);
$arryMonth=array
('January'=>'January','February'=>'February','March'=>'March','April'=>'April','May'=>'May','June'=>'June','July'=>'July','August'=>'August','September'=>'September','October'=>'October','November'=>'November','December'=>'December');
$this->set('arryMonth', $arryMonth);
$data = $this->Hobby->find('list',array('fields' => array
('Hobby.id', 'Hobby.hobby')));
$this->set('arrayHobby', $data);
if (!empty($this->data))
{
$strDate=$this->data['Users']['dobdate']['day']."-".$this->data
['Users']['dobdate']['month']."-".$this->data['Users']['dobdate']
['year'];
$this->data['User']['dob']=strtotime($strDate);
if ($this->User->save($this->data))
{
$user_id=$this->User->getLastInsertId();
for($i=0;$i<count($this->data['UserHobby']['hobby_id']);$i++)
{
if($this->data['UserHobby']['hobby_id'][$i]!='') {
$insertQry="INSERT INTO oc_user_hobbies SET user_id='".
$user_id."',hobby_id='".$this->data['UserHobby']['hobby_id'][$i]."'";
$this->UserHobby->query($insertQry);
}
}
$this->flash('Your has been registed
successfully','viewall_user',
1);
}
}
}
}
C:\xampp\htdocs\oystercafe\app\locale\eng\LC_MESSAGES\default.po file
with following code.
msgid "registration_form"
msgstr "Registration Form"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---