Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Get the table name having the model 14 Sep 2017 03:33 #15290

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello Admin, I am trying to quickly get the table name "#__foo_users" via the model "User" and can't seem to find it. Can you help? Thanks V

Please Log in or Create an account to join the conversation.

Get the table name having the model 15 Sep 2017 08:43 #15291

Try:
$table= JTable::getInstance('user', 'FooTable');
$name = $table->getTableName();

Not via the model, but the shortest way I think.
The following user(s) said Thank You: vlemos

Please Log in or Create an account to join the conversation.

Last edit: by Romkabouter.

Get the table name having the model 17 Sep 2017 02:00 #15292

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello Romkabouter, not exactly what I was looking for, but thanks for the reply. Warm regards, V

Please Log in or Create an account to join the conversation.

Get the table name having the model 18 Sep 2017 15:21 #15293

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Was to share this for a while, but time was against me.
	$table = $model->getTable();	
	$tablename = $table->getTableName();

Warm regards
v
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

Get the table name having the model 20 Sep 2017 09:21 #15300

Ah, you needed it from the model indeed.
Nice one :)

Please Log in or Create an account to join the conversation.

Get the table name having the model 20 Sep 2017 10:59 #15303

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Joomla has a so nice architecture.
Try such thing with Wordpress... lol
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.087 seconds

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started