public static function setContent($title)
 {
     // query database using unique name
     $response = database::selectV1('cms', '*', "title = '{$title}' order by id desc limit 1");
     if (!empty($response)) {
         self::$content = $response[0]['content'];
         self::$title = $response[0]['title'];
         return TRUE;
     } else {
         self::$title = $title;
         return FALSE;
     }
 }
Exemple #2
0
      </div><!-- /input-group -->
    </div><!-- /.col-lg-6 -->
  </form>
  <br><br>          
  <div id="demo0" class="collapse" > 
      <form role="form" method="POST" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" >
        <div class="form-group"> 
          <input    name="title"      class="form-control" type="text" value="<?php 
echo ContentManagementDb::getTitle();
?>
" > 
          <textarea name="content" class="form-control" rows="20"  ><?php 
echo ContentManagementDb::getContent();
?>
</textarea> 
          <button   name="update"  class="btn btn-default" type="submit">Go!</button>
        </div>
    </form>
  </div> 
  <hr> 
</body>
</html> 
  </body> 
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
        <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>  
</html>