jQuery UI provides many fancy user interfaces for web developers. You can follow the steps below in order to use jQuery UI in CakePHP.
1. Download the jQuery UI library at jqueryui.com
2. Unzip the downloaded archive and copy the css folder and two .js files to <CAKEPHP_PROJECT>/app/webroot
- css/<THEMEAME>
- js/jquery-1.4.2.min.js
- js/jquery-ui-1.8.4.custom.min.js
3. Add the following lines in your view file where you want to use the jQuery UI components
<?php echo $html->script('jquery-1.4.2.min.js'); ?> <?php echo $html->script('jquery-ui-1.8.4.custom.min.js'); ?> <?php echo $html->css('<THEME_NAME>/jquery-ui-1.8.4.custom.css'); ?>
4. Let’s add a date picker in a text box as a trial
<!-- jQuery UI trial --> <input type="text" name="date" id="date" /> <script type="text/javascript"> jQuery(document).ready(function($){ $('#date').datepicker(); }); </script>
Done =)
Thanks!
LikeLike
You are welcome. =)
LikeLike
Wow! Thanks!!!!!!!! ^-^
LikeLike
You are welcome. =D
LikeLike
thanks alot it really help
LikeLike
You are welcome and thanks for your comment. =D
LikeLike
Thank you for your post. This does help me alot!
LikeLike
You are welcome~ =)
LikeLike