当前位置: 首页>>代码示例>>PHP>>正文


PHP Post::getTitle方法代码示例

本文整理汇总了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());
 }
开发者ID:donkeycode,项目名称:propel-lockable-behavior,代码行数:14,代码来源:LockableBehaviorTest.php

示例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();
 }
开发者ID:NotBadCode,项目名称:BlogTest,代码行数:7,代码来源:PostsMapper.php

示例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());
 }
开发者ID:GrUSP,项目名称:php_best_practices,代码行数:7,代码来源:PostTest.php

示例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();
     }
 }
开发者ID:j4chal,项目名称:Example-PDO-PHP,代码行数:13,代码来源:PostDAO.php

示例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>';
 }
开发者ID:laiello,项目名称:abbov,代码行数:15,代码来源:pagevisitor.php

示例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>';
 }
开发者ID:laiello,项目名称:abbov,代码行数:15,代码来源:xmlvisitor.php

示例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>';
 }
开发者ID:laiello,项目名称:abbov,代码行数:15,代码来源:rssvisitor.php

示例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>';
 }
开发者ID:laiello,项目名称:abbov,代码行数:18,代码来源:htmlvisitor.php

示例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&iacute;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>
//.........这里部分代码省略.........
开发者ID:KINOTO,项目名称:apymeco,代码行数:101,代码来源:EditView.php

示例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">
开发者ID:salvobertoncini,项目名称:salvobertoncini.com,代码行数:31,代码来源:manage_posts.php

示例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;
 }
开发者ID:kabircse,项目名称:DesignPatternsPHP,代码行数:12,代码来源:PostRepository.php

示例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);
 }
开发者ID:DRONESTUDIO,项目名称:fudit,代码行数:11,代码来源:PostModel.php

示例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>
开发者ID:rakesh-mohanta,项目名称:wix-sdk-sample-app-php,代码行数:31,代码来源:post.show.php

示例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());
 }
开发者ID:picolino0,项目名称:BreezedCMS,代码行数:10,代码来源:coreTest.php

示例15: save

 public function save(Post $post)
 {
     $id = $this->persistence->persist(['text' => $post->getText(), 'title' => $post->getTitle()]);
     $post->setId($id);
 }
开发者ID:paul-schulleri,项目名称:DesignPatternsPHP,代码行数:5,代码来源:PostRepository.php


注:本文中的Post::getTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。