Sunday 6 August 2017

CakePHP Date Picker

Folder Structure:


Controller:

 File location - cakephp/src/controller/HomepageController.php

namespace App\Controller;
use Cake\Controller\Controller;
class HomepageController extends Controller{    public function index()    {       // $this->render('index');    }}


Index:

 File location - cakephp/src/Template/Homepage/index.ctp



Layout:

  File location - cakephp/src/Template/Layout/default.ctp
    Html->charset() ?>
   
    </blockquote> <blockquote class="tr_bq">         <?= $this->fetch('title') ?></blockquote> <blockquote class="tr_bq">    
    Html->meta('icon') ?>

    Html->css('base.css') ?>
    Html->css('cake.css') ?>
    Html->css('datepicker.css') ?>
    Html->script('jquery-3.2.1.min.js') ?>
    Html->script('bootstrap-datepicker.js') ?>

    fetch('meta') ?>
    fetch('css') ?>
    fetch('script') ?>
    fetch('content') ?>     

Webroot Files:

  JS - include the .js files in the following path.


  CSS - include the .css files in the following path.

Brower View:

  Initial View
Datepicker
  After clicking the month

  After clicking the month

No comments:

Post a Comment

CakePHP Date Picker

Folder Structure: Controller:   File location - cakephp/src/controller/HomepageController.php namespace App\Controller; use...