Welcome Guest, Not a member yet? Register   Sign In
$replaceContent = new jquery('replace') and =& get_instance() confusion!!!
#4

[eluser]xwero[/eluser]
There is no reason why the class needs to depend on CI to store the generated tags.

My taconite class
Code:
class Taconite
{
   var $tag_data = array();
   var $generated_tags = array();
   var $opened_tag = '';
  
   function open_tag($name)
   {
      if( ! empty($this->opened_tag))
      {
         return false;
      }
      // name checks here
      $this->opened_tag = $name;
      return true;
   }

   function set($command, $args = NULL)
   {
      $this->tag_data[$this->opened_tag] = array($command,$args);  
   }

   function close_tag($name)
   {
      if($name != $this->opened_tag)
      {
         return false;
      }

      if(! isset($this->tag_data[$this->opened_tag]))
      {
        return false;
      }
      // generate the tags here
      $this->generated_tags[] = $generated_tag;
      unset($this->tag_data[$this->opened_tag]);
      $this->opened_tag = '';
   }

   function create_xml($filepath)
   {
      if(empty($this->generated_tags))
      {
         return false;
      }
      // add tags to xml file
   }
}


Messages In This Thread
$replaceContent = new jquery('replace') and =& get_instance() confusion!!! - by El Forum - 02-24-2009, 04:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB