WebSite-PHP Framework PHP
Mehrsprachig
Einfacher Ajax Modus
Kein HTML, kein JavaScript
URL Rewriting
Mails senden
Sitemap - RSS - Web service
Laden Sie WebSite-PHP FrameWork jetzt herunter
 


Loading
 


Tutorial Calendar

Tutorials

>

Tutorial Calendar



Tutorial 1 : Simple Calendar
Datei: /pages/tutorials/calendar/calendar-01.php

<?php
class Calendar01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple Calendar";
        
        
$this->render = new Calendar($this);
    }
}
?>


Tutorial 2 : Calendar with advance properties
Datei: /pages/tutorials/calendar/calendar-02.php

<?php
class Calendar02 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Calendar 
                                with advance properties"
;
        
        
$this->render = new Calendar($this);
        
        
// set current date
        
$now = new DateTime();
        
$this->render->setValue($now);
        
        
// display buttons "today" and "done"
        
$this->render->showButtonPanel();
        
        
// display combobox to change month
        
$this->render->changeMonth();
        
        
// display combobox to change year
        
$this->render->changeYear();
        
        
// display days of months before and after
        
$this->render->showOtherMonths();
        
        
// display week number
        
$this->render->showWeek();
        
        
// define min date
        
$now->modify("-3 days");
        
$this->render->setMinDate($now);
        
        
// define opening animation
        
$this->render->setShowAnim(Calendar::ANIMATION_BOUNCE);
    }
}
?>


Tutorial 3 : Calendar with form, callback method on change in AJAX
Datei: /pages/tutorials/calendar/calendar-03.php

<?php
class Calendar03 extends Page {
    private 
$edt_date null;
    
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Calendar with form, 
                        callback method on change in AJAX"
;
        
        
$form = new Form($this);
        
        
$this->edt_date = new Calendar($form);
        
$this->edt_date->onChange("onChangeCalendar");
        
$this->edt_date->setAjaxEvent();
        
        
$form->setContent($this->edt_date);
        
$this->render $form;
    }
    
    public function 
onChangeCalendar($sender) {
        if (
get_class($this->edt_date->getValue()) == "DateTime") {
            
$dialog = new DialogBox("onChangeCalendar"
                    
$this->edt_date->getValue()->format("m-d-Y"));
            
$this->addObject($dialog);
        }
    }
}
?>


Tutorial 4 : Calendar with LiveValidation
Datei: /pages/tutorials/calendar/calendar-04.php

<?php
class Calendar04 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Calendar with LiveValidation";
        
        
$form = new Form($this);
        
        
$edt_date = new Calendar($form);
        
$lv = new LiveValidation();
        
$lv->addValidateCalendar($edt_date->getDateFormat());
        
$edt_date->setLiveValidation($lv);
        
        
$form->setContent($edt_date);
        
$this->render $form;
    }
}
?>



Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Start Dokumentation Herunterladen Schnellstart Tutorials Wiki Issue Tracker