PHP
- 7 ответов
- 0 вопросов
2
Вклад в тег
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
// Static server
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: "./",
index: "other.html"
}
});
});
<?php
// Demo.php
class Demo {
public $title = null;
public $postData = null;
public function __construct() {
$this->title = 'Bla Bla Bla';
$this->postData = (object) array(
'title' => 'Post Title',
'content' => 'Post content'
);
}
}
?>
<?php
// template.php
$post = new Demo;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $post->title; ?></title>
</head>
<body>
<p><?php echo $post->postData->title; ?></p>
<p><?php echo $post->postData->content; ?></p>
</body>
</html>