manuja
(Ujithamanuja)
February 9, 2015, 2:39pm
1
Hi friends today my aim is to create simple jquery date time picker with Yii.
Follow me.
Step 01 -> Create the controller as follows.
<?php
class DateController extends Controller{
public function actionDate(){
$this->render('date');
}
}
Step 02 -> Create the view file.
<html>
<head></head>
<body>
</body>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/assets/jquery.datetimepicker.css" media="screen, projection">
<script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/jquery.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/jquery.datetimepicker.js"></script>
<form id="one">
<input id="datetimepicker" type="text">
</form>
<script>
jQuery('#datetimepicker').datetimepicker();
</script>
</html>
Step 03-> This is step is to link the relavant css and js files of the step 02 code.
please refer the attchments for this step.please.
vient74
(Vient74)
February 9, 2015, 2:46pm
2
Ujitha Manuja Sudasingha:
Hi friends today my aim is to create simple jquery date time picker with Yii.
Follow me.
Step 01 -> Create the controller as follows.
<?php
class DateController extends Controller{
public function actionDate(){
$this->render('date');
}
}
Step 02 -> Create the view file.
<html>
<head></head>
<body>
</body>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/assets/jquery.datetimepicker.css" media="screen, projection">
<script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/jquery.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/jquery.datetimepicker.js"></script>
<form id="one">
<input id="datetimepicker" type="text">
</form>
<script>
jQuery('#datetimepicker').datetimepicker();
</script>
</html>
Step 03-> This is step is to link the relavant css and js files of the step 02 code.
please refer the attchments for this step.please.
Hai Ujitha, I am using ext. ejuidatetimepicker to make datetimepicker like as you want and used that really simple
http://www.yiiframework.com/extension/ejuidatetimepicker/
manuja
(Ujithamanuja)
February 9, 2015, 2:56pm
3
You are correct.But my idea is to integrate the functions of Yii with normal web technologies like jquery,javascript. Try my example it is so much easy to a beginner