Yii Framework Forum: Yii Keeps Adding 's' To Table Names From Mssql - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii Keeps Adding 's' To Table Names From Mssql Rate Topic: -----

#1 User is offline   klaudyuxxx 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 22-January 13

Posted 24 January 2013 - 09:56 AM

Hello!
I'm new here, and I hope I'm posting in the correct section.

As the title says, Yii->Gii is adding the letter 's' to every MSSQL table name. I'm using GII to generate CRUDs and Models. I found another post on the same topic, but on another framework's forum <_< (ruby on rails). Here is the link to the post: www.ruby-forum.com/topic/68292 . Someone there mentioned something about pluralized table names, and someone else came up with a solution to disable this feature in the framework with this property: ActiveRecord::Base.pluralize_table_names = false .
I looked up in CActiveRecord class reference for a similar property, but couldn't find it, so I'm stuck.

Any help would be appreciated!
0

#2 User is offline   klaudyuxxx 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 22-January 13

Posted 24 January 2013 - 10:50 AM

I think I may have found something, but I'm not sure of it.
The below code is part of several php files in default template directory of GII.
Should I make a new template and remove the pluralize part? :unsure:
<?php
$nameColumn=$this->guessNameColumn($this->tableSchema->columns);
$label=$this->pluralize($this->class2name($this->modelClass));
echo "\$this->breadcrumbs=array(
	'$label'=>array('index'),
	\$model->{$nameColumn},
);\n";
?>

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users