Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| <?php | |
| function load_js_template(){ | |
| get_template_part( 'sample-template' ); | |
| } | |
| add_action( 'wp_footer', 'load_js_template' ); | |
| function render_template( $template_name, $tmpl_data ) { | |
| // "/" should not be present, but let's sanitize just in case | |
| $template_name = str_replace( '/', '_', $template_name ); |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Building a router</title> | |
| <script> | |
| // Put John's template engine code here... | |
| (function () { | |
| // A hash to store our routes: |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| <? | |
| if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted | |
| $title = $_POST['thread_title']; //set our title | |
| if ($_POST['thread_description']=="") { // check if a description was entered | |
| $description = "See thread title..."; // if not, use placeholder | |
| } else { | |
| $description = $_POST['thread_description']; //if so, use it |