本文整理汇总了PHP中Content::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Content::getTitle方法的具体用法?PHP Content::getTitle怎么用?PHP Content::getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Content
的用法示例。
在下文中一共展示了Content::getTitle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doInsert
protected function doInsert(Content $content)
{
$now = time();
$query = "INSERT INTO albums " . "(slug, title, datecreated, datemodified, status, datedisplayed, newsid, eventid, featuredimageid) " . "VALUES " . "('{$content->getSlug()}','{$content->getTitle()}','{$now}','{$now}','{$content->getStatus()}','{$content->getDateDisplayed()}','{$content->getNewsId()}','{$content->getEventId()}','{$content->getFeaturedImageId()}')";
self::$mysqli->query($query);
$content->setId(self::$mysqli->insert_id);
}
示例2: doInsert
protected function doInsert(Content $object)
{
$now = time();
$query = "INSERT INTO newsevents " . "(status, slug, title, datecreated, datemodified, text, description, keywords, datedisplayed, type) " . "VALUES " . "('{$object->getStatus()}', '{$object->getSlug()}','{$object->getTitle()}', '{$now}','{$now}','{$object->getText()}','{$object->getDescription()}','{$object->getKeywords()}','{$object->getDateDisplayed()}','{$object->getContentType()}')";
//echo $query;
self::$mysqli->query($query);
$object->setId(self::$mysqli->insert_id);
}
示例3: title
/**
* Returns the title of the current page.
*
* @package Theme
* @return string The title.
*/
function title()
{
return Content::getTitle();
}
示例4: update
public function update(Content $image)
{
$now = time();
$query = "UPDATE images SET " . "slug='{$image->getSlug()}', " . "title='{$image->getTitle()}', " . "datemodified='{$now}', " . "albumid='{$image->getAlbumId()}', " . "filename='{$image->getFileName()}', " . "status='" . Content::STATUS_LIVE . "', " . "prospective='{$image->getProspective()}', " . "current='{$image->getCurrent()}', " . "staff='{$image->getStaff()}' " . "WHERE id={$image->getId()}";
self::$mysqli->query($query);
}
示例5: setContent
function setContent($content_body)
{
$this->content_body = htmlentities("{$content_body}");
}
function getContent()
{
return $this->content_body;
}
}
/* Test Id */
$content = new Content();
$content->setID();
$content->setID();
$content->setID();
$content->setID();
$content->setID();
$content->setID() . '<br/>';
$content->setAuthor('Guillermina', 'Gonjon') . '<br/>';
$content->setTitle("this is my title") . '<br/>';
$content->setContent("This is an example of what this page can do. This is my content for this page.");
echo $content->getAuthor() . '<br/>';
echo $content->getDate() . '<br/>';
echo $content->getTitle() . '<br/>';
echo $content->getContent() . '<br/>';
$theid = $content->content_id;
echo $content->formatID($theid) . '<br/>';
var_dump($content);
//echo $content->formatted_id.'<br/>';
$output = shell_exec('cal 2016 | grep 2016') . '<br/>';
//echo "<pre>$output</pre>";
//echo "<br>".phpversion().'<br/>';
示例6: updateSlug
/**
* Double checks a content slug after a potential title change
*
* If the title hasn't changed then return. Else generate a new slug
* This requires requires n runs to the database, where n is the number of duplicate slugs
* TODO: Optimize this so we need at most one trip to the database, hint: use LIKE '$newSlug%;
*
* @param $content Content the content object who's slug we need to update
*/
protected function updateSlug(Content $content)
{
$oldSlug = $content->getSlug();
$newSlug = $this->generateSlug($content->getTitle());
if ($oldSlug == $newSlug) {
return;
}
$suffix = '';
while ($this->findBySlug($newSlug . $suffix) !== null) {
if ($suffix == '') {
$suffix = 1;
}
$suffix++;
}
$content->setSlug($newSlug . $suffix);
}