Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Setting the Table Name on Init
  • My app has 3 tables whose names can change based on what happens during the install. I need to be able to set the name of the table on init. I created an _init method and made the change in there. public static function _init()
    {
    static::$_table_name = static::$_table_name.'foo';
    } Unfortunately though, when I call the find method, Fuel throws an exception because it can't find the table, except the table it's trying to find is the table WITHOUT the change I made in the _init method. Model_Position::find(1);
    // it's looking for the table positions_ instead of positions_foo How exactly do I get Fuel to change the table name property on init so that it works as expected?
  • Useful reply.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion