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
  • Online
  • 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
  • Online
  • 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
  • Online
  • 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.127 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started