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.061 seconds

  Merci d'avoir présenté ce service web générateur de composant joomla. L'interface est très conviviale on a le plaisir du drag&drop et c'est assez rare pour être signalé. Je souhaite que ce projet connaisse un fort succès votre réalisation est méritante.
Yann Gomiero (AFUJ - France)

Get Started