/www/application/models/link.php

https://github.com/chardcastle/mysite · PHP · 24 lines · 16 code · 4 blank · 4 comment · 0 complexity · 83f581675624a76d094adbe66ca4ed03 MD5 · raw file

  1. <?php defined('SYSPATH') or die('No direct script access.');
  2. class Link_Model extends App_Model {
  3. public $title = "";
  4. public $destination = "";
  5. public function __construct()
  6. {
  7. // load database library into $this->db (can be omitted if not required)
  8. parent::__construct();
  9. }
  10. public function loadFromLocalSource($content){
  11. //preg_match('/\"link-text\"\:\"(.*)\",/i',$content,$this->result);
  12. $this->title = $content["link-text"];
  13. //preg_match('/\"link-url\"\:\"(.*)\",/i',$content,$this->result);
  14. $this->destination = $content["link-url"];
  15. // view
  16. $view = new View("item_summary/link");
  17. $view->set("link",$this);
  18. return $view->render();
  19. }
  20. }