-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demo files that don't start with TEST_
- Loading branch information
Showing
10 changed files
with
197 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace App\Controllers; | ||
|
||
use Twist\Core\Controllers\BaseAJAX; | ||
|
||
class AJAX123 extends BaseAJAX { | ||
|
||
public function knock() { | ||
$this -> _ajaxFail(); | ||
$this -> _ajaxMessage( 'The knock was too quiet' ); | ||
return $this -> _ajaxRespond(); | ||
} | ||
|
||
public function ring() { | ||
$this -> _ajaxMessage( 'The doorbell made a noise' ); | ||
$objResponse = array( | ||
'response' => 'Hello? Who\'s there?', | ||
'datetime' => date( 'Y-m-d H:i:s' ) | ||
); | ||
return $this -> _ajaxRespond( $objResponse ); | ||
} | ||
|
||
public function POSTage() { | ||
$this -> _ajaxMessage( 'Your age was calculated' ); | ||
$objResponse = array( | ||
//'yourDob' => $this -> _posted( 'dob' ), | ||
'yourAge' => \Twist::DateTime() -> getAge( strtotime( $this -> _posted( 'dob' ) ) ) | ||
); | ||
return $this -> _ajaxRespond( $objResponse ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Controllers; | ||
use \Twist\Core\Controllers\Base; | ||
|
||
class HelloWorld extends Base { | ||
|
||
public function _index() { | ||
return $this -> _view( 'welcome.tpl' ); | ||
} | ||
|
||
public function view() { | ||
return $this -> _view( 'views.tpl' ); | ||
} | ||
|
||
public function ajaxrequests() { | ||
return $this -> _view( 'ajax.tpl' ); | ||
} | ||
|
||
public function testuploads() { | ||
return $this -> _view( 'upload.tpl' ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
class Books { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html class="no-js" lang="en-GB"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>TwistPHP - The PHP MVC Framework with a TWIST</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"> | ||
{resource:arable} | ||
{resource:modernizr} | ||
</head> | ||
<body> | ||
<h1>AJAX</h1> | ||
<form id="test-form"> | ||
<input name="firstname" type="text" value="Philip"> <input name="lastname" type="text" value="Fry"> <input name="dob" type="date" value="1974-08-14"> | ||
</form> | ||
{resource:babel,polyfill} | ||
{resource:twist/ajax} | ||
<script> | ||
var door = new twistajax( '/ajax' ); | ||
door.get( 'knock' ) | ||
.then( response => { | ||
console.log( response ); | ||
} ) | ||
.catch( e => { | ||
console.error( 'Sorry, I didn\'t hear you knock because: ' + e ); | ||
door.get( 'ring' ) | ||
.then( response => { | ||
console.log( response ); | ||
} ) | ||
.catch( e => { | ||
console.error( 'Sorry, I didn\'t hear you ring because: ' + e ); | ||
} ); | ||
} ); | ||
door.post( 'age', { | ||
firstname: 'Andrew', | ||
lastname: 'Hosgood', | ||
dob: '1986-09-24' | ||
} ) | ||
.then( response => { | ||
console.log( response ); | ||
} ) | ||
.catch( e => { | ||
console.error( 'Something broke:', e ); | ||
} ); | ||
door.postForm( 'age', '#test-form' ) | ||
.then( response => { | ||
console.log( response ); | ||
} ) | ||
.catch( e => { | ||
console.error( 'Something broke:', e ); | ||
} ); | ||
door.postForm( 'age2', '#test-form' ) | ||
.then( response => { | ||
console.log( response ); | ||
} ) | ||
.catch( e => { | ||
console.error( 'Something broke:', e ); | ||
} ); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html class="no-js" lang="en-GB"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>TwistPHP - The PHP MVC Framework with a TWIST</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"> | ||
{resource:arable} | ||
{resource:modernizr} | ||
</head> | ||
<body> | ||
<h1>Uploading</h1> | ||
|
||
<div id="twistupload-test-1"></div> | ||
<div id="twistupload-test-2"></div> | ||
<div id="twistupload-test-3"></div> | ||
<div id="twistupload-test-4"></div> | ||
{resource:twist/fileupload} | ||
<script> | ||
var fileuploadtest1 = new twistfileupload( 'twistupload-test-1', '/upload/file', 'test-1', false, { foo: 'bar' } ); | ||
var fileuploadtest2 = new twistfileupload( 'twistupload-test-2', '/upload/file', 'test-2', true, { foo: 'bar' } ); | ||
var fileuploadtest3 = new twistfileupload( 'twistupload-test-3', '/upload/asset', 'test-3', false, { foo: 'bar' } ); | ||
var fileuploadtest4 = new twistfileupload( 'twistupload-test-4', '/upload/asset', 'test-4', true, { foo: 'bar' } ); | ||
</script> | ||
<!-- | ||
{file:upload} | ||
{file:upload,multiple=1} | ||
{asset:upload} | ||
{asset:upload,multiple=1} | ||
--> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html class="no-js" lang="en-GB"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>TwistPHP - The PHP MVC Framework with a TWIST</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"> | ||
{resource:arable} | ||
{resource:modernizr} | ||
</head> | ||
<body> | ||
<h1>Welcome!</h1> | ||
<h2>What a beautiful {date:l} it is :)</h2> | ||
<script> | ||
causeanerror( 'Foo bar' ); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html class="no-js" lang="en-GB"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>TwistPHP - The PHP MVC Framework with a TWIST</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"> | ||
{resource:arable} | ||
{resource:modernizr} | ||
</head> | ||
<body> | ||
<h1>TwistPHP</h1> | ||
<ul> | ||
<li><a href="/view">Views</a></li> | ||
<li><a href="/ajaxrequests">AJAX requests</a></li> | ||
<li><a href="/uploads">Fie uploads</a></li> | ||
</ul> | ||
</body> | ||
</html> |
2 changes: 1 addition & 1 deletion
2
dist/twist/Core/Resources/twist/fileupload/js/twistfileupload.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters