本文整理汇总了PHP中Post::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Post::getTitle方法的具体用法?PHP Post::getTitle怎么用?PHP Post::getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Post
的用法示例。
在下文中一共展示了Post::getTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLockedFields
public function testLockedFields()
{
$post = new Post();
$post->activateLocker();
$post->activateLockCheck();
$post->setTitle('A super book');
$post->save();
$this->assertTrue($post->getTitleLock());
$this->assertEquals('A super book', $post->getTitle());
$post->setTitle('New Title');
$this->assertEquals('New Title', $post->getTitle());
$post->save();
$this->assertEquals('A super book', $post->getTitle());
}
示例2: editPost
public function editPost(Post $post)
{
$STH = $this->DBH->prepare("UPDATE Posts SET textpost=:textpost, title=:title\n WHERE id=:id");
$STH->bindValue(":textpost", $post->getTextpost());
$STH->bindValue(":title", $post->getTitle());
$STH->execute();
}
示例3: testNewPostFromArray
public function testNewPostFromArray()
{
$data = array('title' => 'titolo del post', 'intro' => 'intro del post', 'body' => 'il body', 'image' => 'nice.jpg', 'published_at' => new DateTime('now'));
$post = new Post();
$post->fromArray($data);
$this->assertEquals('titolo del post', $post->getTitle());
}
示例4: insert
public function insert(Post $post)
{
$this->conn->beginTransaction();
try {
$stmt = $this->conn->prepare('INSERT INTO posts (title, content) VALUES (:title, :content)');
$stmt->bindValue(':title', $post->getTitle());
$stmt->bindValue(':content', $post->getContent());
$stmt->execute();
$this->conn->commit();
} catch (Exception $e) {
$this->conn->rollback();
}
}
示例5: visitPost
function visitPost(Post $p)
{
$text = $p->getText();
$title = $p->getTitle();
$author = $p->getAuthor();
$time = $p->getTime();
$tags = $this->tagsToString($p->getTags());
echo '<div id="post">';
echo '<b>' . $title . "</b><br>";
echo $author . ' @ ' . date("H:i:s - d/m/Y", $time) . '<br>';
echo 'Tags: ' . $tags . '<br><br>';
echo $text;
echo "<br><br>";
echo '</div>';
}
示例6: visitPost
function visitPost(Post $p)
{
$text = $p->getText();
$title = $p->getTitle();
$author = $p->getAuthor();
$time = $p->getTime();
$tags = $this->tagsToString($p->getTags());
echo '<post>';
echo '<title>' . utf8_encode($title) . '</title>';
echo '<author>' . utf8_encode($author) . '</author>';
echo '<time>' . utf8_encode(date("H:i:s - d/m/Y", $time)) . '</time>';
echo '<tags>' . utf8_encode($tags) . '</tags>';
echo '<text>' . utf8_encode($text) . '</text>';
echo '</post>';
}
示例7: visitPost
function visitPost(Post $p)
{
$text = $p->getText();
$title = $p->getTitle();
$author = $p->getAuthor();
$time = $p->getTime();
$id = $p->getID();
echo '<item>';
echo '<guid isPermaLink="false">' . utf8_encode("ABBOV_ID_" . $id) . '</guid>';
echo '<title>' . utf8_encode($title) . '</title>';
echo '<description>' . utf8_encode($text) . '</description>';
echo '<pubDate>' . date("D, d M Y G:i:s O", $time) . '</pubDate>';
echo '<dc:creator>' . $author . '</dc:creator>';
echo '</item>';
}
示例8: visitPost
function visitPost(Post $p)
{
$text = $p->getText();
$title = $p->getTitle();
$author = $p->getAuthor();
$time = $p->getTime();
$tags = $this->tagsToString($p->getTags());
$id = $p->getID();
echo '<div class="post">';
echo '<b>' . $title . "</b><br>";
echo $author . ' @ ' . date("H:i:s - d/m/Y", $time) . '<br>';
echo 'Tags: ' . $tags . '<br><br>';
echo $text;
echo "<br><br>";
echo '<a href="deletepost.php?id=' . $id . '">Delete post</a>';
echo "<br><br>";
echo '</div>';
}
示例9: render
/**
* Renderize the view.
*
* @return null
*/
public function render(Post $post)
{
?>
<!-- JQUERY UI -->
<link type="text/css" rel="stylesheet" href="<?php
echo APP_PATH;
?>
/css/jquery-ui.min.css">
<link type="text/css" rel="stylesheet" href="<?php
echo APP_PATH;
?>
/css/jquery-ui.theme.min.css">
<script type="text/javascript" src="<?php
echo APP_PATH;
?>
/js/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function(){
$("#date").datepicker({dateFormat: "yy-mm-dd"});
});
</script>
<p>
<?php
echo REQUIRED_FIELDS_TEXT;
?>
</p>
<form action="<?php
echo $this->generateURL('post', 'edit', $post->getIdPost());
?>
" method="post">
<fieldset>
<div class="row">
<div class="col-md-6">
<div>
<label for="title">
Título <small>(*)</small>
</label>
<input name="title" type="text" required value="<?php
echo $post->getTitle();
?>
" />
</div>
<div>
<label for="headline">
Copete <small>(*)</small>
</label>
<textarea name="headline" required><?php
echo $post->getHeadline();
?>
</textarea>
</div>
<div>
<label for="date">
Fecha <small>(*)</small>
</label>
<input id="date" name="date" type="text" required value="<?php
echo $post->getDate();
?>
" />
</div>
<div>
<label for="body">
Cuerpo <small>(*)</small>
</label>
<textarea name="body" required><?php
echo $post->getBody();
?>
</textarea>
</div>
</div>
<div class="col-md-6">
<div>
<label for="source">
Fuente <small>(*)</small>
</label>
<input name="source" type="text" value="<?php
echo $post->getSource();
?>
" required />
</div>
//.........这里部分代码省略.........
示例10: foreach
if ($resp["response"]) {
$optionList = $resp["allPosts"];
foreach ($optionList as $post) {
echo '<option value="' . $post->getId() . '">' . $post->getTitle() . '</option>';
}
} else {
echo '<option value="">nessun post</option>';
}
?>
</select></div><div class="col-md-2">
<input class="form-control" type="hidden" name="action" id="action" value="add_get"><input type="submit" class="btn btn-warning" value="Select Post"></div>
</form>
<br><br><br>
<form action="../controller/post_controller.php" method="POST">
<textarea class="form-control" type="text" name="title" id="title" ><?php
echo $postOnGet->getTitle();
?>
</textarea><br>
<textarea class="form-control" type="text" name="subtitle" id="subtitle" ><?php
echo $postOnGet->getSubTitle();
?>
</textarea><br>
<textarea class="form-control" type="text" name="text" id="text"><?php
echo $postOnGet->getText();
?>
</textarea><br>
<input class="form-control" type="date" name="date" id="date" <?php
echo 'value=' . $postOnGet->getDate();
?>
><br>
<select class="form-control editAvatar" name="image" id="avatar">
示例11: save
/**
* Save post object and populate it with id
*
* @param Post $post
* @return Post
*/
public function save(Post $post)
{
$id = $this->persistence->persist(array('author' => $post->getAuthor(), 'created' => $post->getCreated(), 'text' => $post->getText(), 'title' => $post->getTitle()));
$post->setId($id);
return $post;
}
示例12: editPost
/**
* Modify a post saved in the database.
*
* @param Post $post
* @return integer
*/
public function editPost(Post $post)
{
$sql = "UPDATE post \n\t\t\tSET id_post = '" . $post->getIdPost() . "', category = '" . $post->getCategory() . "', title = '" . replaceCharacters($post->getTitle()) . "', body = '" . $this->formatBody(replaceCharacters($post->getBody())) . "', video = '" . $post->getVideo() . "' WHERE id_post = '" . $post->getIdPost() . "'";
return DB::query($sql);
}
示例13: getWixWidth
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://static.wix.com/services/wix-public/1.8.0/js/Wix.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
Wix.reportHeightChange($('body').outerHeight(true));
});
</script>
</head>
<body style="width: <?php
print getWixWidth();
?>
">
<!-- POST -->
<div>
<h1><?php
print $post->getTitle();
?>
</h1>
<div style="padding-top: 10px">
<?php
print nl2br($post->getBody());
?>
</div>
</div>
</body>
</html>
示例14: testPost
public function testPost()
{
$date = new \DateTime();
$post = new Post(123, 1, 'A post', 'Some content', 2, $date, 1, 0);
$this->assertEquals(123, $post->getID());
$this->assertEquals('A post', $post->getTitle());
$this->assertEquals('Some content', $post->getContent());
$this->assertEquals(2, $post->getVisibility());
$this->assertEquals($date, $post->getDate());
}
示例15: save
public function save(Post $post)
{
$id = $this->persistence->persist(['text' => $post->getText(), 'title' => $post->getTitle()]);
$post->setId($id);
}