Exemplo n.º 1
0
Arquivo: index.php Projeto: 4lb0/qadwa
<?php

require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/src/Qadwa.php';
print Qadwa::getInstance(array('baseUrl' => '/examples/03_simplesite/'));
Exemplo n.º 2
0
Arquivo: index.php Projeto: 4lb0/qadwa
<?php

// Include the class
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/src/Qadwa.php';
// Just print the Qadwa instance
print Qadwa::getInstance(array('baseUrl' => '/examples/01_helloworld/'));
Exemplo n.º 3
0
Arquivo: index.php Projeto: 4lb0/qadwa
<?php

// this is only to show how
Qadwa::getInstance()->redirect('qadwa/show');
Exemplo n.º 4
0
Arquivo: index.php Projeto: 4lb0/qadwa
<?php

require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/src/Qadwa.php';
print Qadwa::getInstance(array('baseUrl' => '/examples/05_controller/'));
Exemplo n.º 5
0
Arquivo: index.php Projeto: 4lb0/qadwa
<?php

require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/src/Qadwa.php';
// This is the same case that the hello world example but now
// you must ensure to have the .htacess and the Apache Rewrite module
print Qadwa::getInstance(array('baseUrl' => '/examples/02_static/'));
Exemplo n.º 6
0
Arquivo: index.php Projeto: 4lb0/qadwa
<?php

session_start();
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/src/Qadwa.php';
if (!isset($_SESSION['debug'])) {
    $_SESSION['debug'] = 0;
}
print Qadwa::getInstance(array('baseUrl' => '/examples/06_errors/', 'debug' => $_SESSION['debug'], 'error400Template' => 'error/not-found', 'error500Template' => 'error/internal'));
Exemplo n.º 7
0
<?php

// here we check if a POST is received.
if (Qadwa::getInstance()->isPost()) {
    $body = '';
    foreach (array('name', 'email', 'message') as $name) {
        $value = $_POST[$name];
        $body .= "{$name}: {$value}\n";
    }
    // Here fetch the user defined configuration
    // it is in the etc/defaul.ini file
    $contactMail = Qadwa::getInstance()->contact_mail;
    $result = mail($contactMail, 'Contact', $body);
    $message = $result ? 'Form sended ok!' : 'There was an error while sending the form';
} else {
    $message = null;
}
// Set the var to the template
// yes! is a return without any function,
// it terminates the processing in this file
// you can check more info in http://php.net/include
return array('message' => $message);
Exemplo n.º 8
0
Arquivo: index.php Projeto: 4lb0/qadwa
<?php

require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/src/Qadwa.php';
print Qadwa::getInstance(array('baseUrl' => '/examples/04_views/', 'templateFile' => 'templates/%s.html', 'layoutFile' => 'templates/%s.html', 'defaultModule' => 'home', 'layout' => false));