Welcome Guest, Not a member yet? Register   Sign In
Call my website functions from another website...?
#6

[eluser]Colin Williams[/eluser]
Quote:What do you mean by make your own models? Can you post a simple example?

So, when you write a CI model, you are extending the Model class, which gives you access to all that CI has to offer. Imagine writing a model that simply does not rely on extending CI's Model class. This means no CI libs, no CI config, no DB class or ActiveRecord. You give up a lot, but you gain that flexibility.

Here's some pseudo-code:

Code:
class Poll_model {

   function Poll_model()
   {
      // Check for db connection, connect if there is none, or throw an error
   }

   function get_poll($pid)
   {
      return mysql_query('SELECT * FROM '. mysql_real_escape_string('poll')
                        .' WHERE pid='. mysql_real_escape_string($pid));
   }

}


Messages In This Thread
Call my website functions from another website...? - by El Forum - 09-30-2008, 05:58 PM
Call my website functions from another website...? - by El Forum - 09-30-2008, 06:11 PM
Call my website functions from another website...? - by El Forum - 09-30-2008, 11:07 PM
Call my website functions from another website...? - by El Forum - 09-30-2008, 11:21 PM
Call my website functions from another website...? - by El Forum - 10-01-2008, 12:18 AM
Call my website functions from another website...? - by El Forum - 10-01-2008, 01:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB