‘registerModels’=>array(‘application.models.*’) dont works, function getObjectPluralName gets empty string
‘registerModels’=>array(‘application.models.*’) dont works, function getObjectPluralName gets empty string
I think it is due to that Windows directory separator is "\".
Fixed it using DIRECTORY_SEPARATOR. http://github.com/firstrow/yiiadmin/commit/816d69bf90bba77feb26699bccb92168996db29a#L0R74
Здравствуйте, мне нужна ваша помощь у меня есть модель на yiiadmin \ моделей следующее сообщение об ошибке, но все же помогите мне поблагодарить вас
Fatal error: Class ‘Topic’ not found in F:\www\test\protected\modules\yiiadmin\YiiadminModule.php on line 114
mian.config
‘modules’=>array(
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'123456',
'generatorPaths'=>array(
'application.gii',
),
),
'forum',
'yiiadmin'=>array(
'password'=>'123456',
'registerModels'=>array(
'application.models.Topic',
//'application.models.BlogPosts',
//'application.models.*',
),
//'excludeModels'=>array(),
),
),
Можете мне скинуть код модели? Так сходу сказать в чем проблема не могу.
ПС. может лучше продолжит разговор на русском форуме?
Models List
class Topic extends CActiveRecord { public function attributeLabels() { return array( ‘tid’ => Yii::t(‘application’,‘Tid’), ‘authorid’ => Yii::t(‘application’,‘Authorid’), ‘authorname’ => Yii::t(‘application’,‘Authorname’), ‘subject’ => Yii::t(‘application’,‘Subject’), ‘dataline’ => Yii::t(‘application’,‘Dataline’), ); } }
Fatal error: Class ‘Topic’ not found in F:\www\test\protected\modules\yiiadmin\YiiadminModule.php on line 237
Модели сообщили об ошибке, но все еще может помочь мне поблагодарить вас, у меня под анализа
Haven’t had a chance to try this out yet but i really like what you are doing here. I’m looking forward to see where this is going.
Great job so far!
What would be the easiest way to get a listBox multiple-select field in model-create view, that
would display many-to-many relation, for example I have a ‘pivot’ table that holds these
article-category relationships, along with Article and Category tables.
I already have these relations defined in models, and I even managed to get some other
relations into list view, like Author.name acquired through author_id field in Article table.
Now I want the Article creation
form to contain multiple select listBox that would save into this pivot table automatically
multiple choices of categories the Article belongs to.
Those would be, therefore, multiple entries/rows into article_category pivot table by one
Article submission.
At the same time, the Article table itself does not contain any field that refers to category.
The pivot table therefore picks up article’s id attribute and connects it with categorie’s (another model/table)
id and makes a row out of this.
So, for example, I have these tables/models:
Article >>> id | title | author | text
Category >>> id | name | description
ArticleCategory >>> id | article_id | category_id
And I want to populate this third pivot table with multiple rows from multiple select listBox
from the Article create view/form of yiiadmin (often through only one submission).
I also want to automatically render category.name from the Category table into this listbox, appropriately related
to category id-s so that I can show names from category table, and by choice & submission populate pivot table with
id-s of a category (therefore not names)
Is this possible, and what would be the best way to do this?
yes, and kudos for the extension!
Did anyone get this working?
hello,
i have a problem…
my application said this:
message is quiet explicit IMHO