我正在尝试从此处实现 datepicker, 并将所有文件相应地复制到 js 和 css 文件夹中,并尝试在此页面上调用 datepicker,但它没有显示。这是页面的代码:
<?php
echo $this->Html->script('jquery-1.9.1.js');
echo $this->Html->script('bootstrap.js');
echo $this->Html->script('bootstrap-datepicker.js');
echo $this->Html->css('bootstrap.css');
echo $this->Html->css('bootstrap-responsive.css');
echo $this->Html->css('datepicker.css');
?>
<div class="users form">
<?php echo $this->Form->create('User');?>
<fieldset>
<legend><?php echo __('Edit User'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('full_name');
echo $this->Form->input('first_name');
echo $this->Form->input('last_name');
echo $this->Form->input('email', array('readonly' => true));
?>
</fieldset>
<fieldset>
<?php
echo $this->Form->input('zip');
echo $this->Form->input('gender', array('type' => 'radio', 'options' => array('male' => 'M', 'female' => 'F'),
'legend' => false, 'value' => isset($this->data['User']['gender']) ? $this->data['User']['gender'] : 'male'));
echo $this->Form->input('birthday', array('class' => 'datepicker', 'type' => 'text', 'label' => false));
?></fieldset>
<?php echo $this->Form->end(array('class'=>'btn btn-primary'));?>
</div>
<script type="text/javascript">
<!--
//-->
$(document).ready(function() {
$('#datepicker').datepicker({
format: 'mm-dd-yyyy'
});
});
</script>