segoddnja / comments-module Goto Github PK
View Code? Open in Web Editor NEWComments module for Yii framework
Comments module for Yii framework
in Comments/CommentModule.php
add new public value $tableName='tbl_comments';
in Comments/models/Comment.php
public function tableName()
{
return Yii::app()->getModule('user')->tableName;
}
this solution will make customizable name of table
Добрый день! Спасибо за Ваш модуль. Не могли бы Вы выложить дамп таблички, необходимой для работы Вашего расширения ? Или я плохо искал ?
I keep on getting the following error "This item can't be commentable" what should I do to fix this
Please help!
[error] [php] include(ECommentsBaseWidget.php) [function.include]: failed to open stream: No such file or directory (F:\WEB\domains\yii\www\framework\YiiBase.php:427)
Stack trace:
#0 unknown(0): spl_autoload_call()
#1 F:\WEB\domains\yii\www\protected\modules\comments\models\Comment.php(338): class_exists()
#2 F:\WEB\domains\yii\www\framework\base\CComponent.php(111): Comment->getOwnerModel()
#3 F:\WEB\domains\yii\www\framework\db\ar\CActiveRecord.php(145): Comment->__get()
#4 F:\WEB\domains\yii\www\protected\modules\comments\controllers\CommentController.php(140): Comment->__get()
#5 F:\WEB\domains\yii\www\framework\web\actions\CInlineAction.php(49): CommentController->actionPostComment()
#6 F:\WEB\domains\yii\www\framework\web\CController.php(308): CInlineAction->runWithParams()
#7 F:\WEB\domains\yii\www\framework\web\filters\CFilterChain.php(133): CommentController->runAction()
#8 F:\WEB\domains\yii\www\framework\web\CController.php(1130): CFilterChain->run()
#9 F:\WEB\domains\yii\www\framework\web\filters\CInlineFilter.php(58): CommentController->filterAjaxOnly()
#10 F:\WEB\domains\yii\www\framework\web\filters\CFilterChain.php(130): CInlineFilter->filter()
#11 F:\WEB\domains\yii\www\framework\web\filters\CFilter.php(40): CFilterChain->run()
#12 F:\WEB\domains\yii\www\framework\web\CController.php(1145): CAccessControlFilter->filter()
#13 F:\WEB\domains\yii\www\framework\web\filters\CInlineFilter.php(58): CommentController->filterAccessControl()
#14 F:\WEB\domains\yii\www\framework\web\filters\CFilterChain.php(130): CInlineFilter->filter()
#15 F:\WEB\domains\yii\www\framework\web\CController.php(291): CFilterChain->run()
#16 F:\WEB\domains\yii\www\framework\web\CController.php(265): CommentController->runActionWithFilters()
#17 F:\WEB\domains\yii\www\framework\web\CWebApplication.php(282): CommentController->run()
#18 F:\WEB\domains\yii\www\framework\web\CWebApplication.php(141): CWebApplication->runController()
#19 F:\WEB\domains\yii\www\framework\base\CApplication.php(180): CWebApplication->processRequest()
#20 F:\WEB\domains\yii\www\index.php(13): CWebApplication->run()
REQUEST_URI=/comments/comment/postComment
in F:\WEB\domains\yii\www\protected\modules\comments\models\Comment.php (338)
in F:\WEB\domains\yii\www\protected\modules\comments\controllers\CommentController.php (140)
in F:\WEB\domains\yii\www\index.php (13)
выкидывает ошибку 1
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM
in path\www\protected\modules\comments\models\Comment.php on line 340
имхо для исправления строку
https://github.com/segoddnja/Comments-module/blob/master/models/Comment.php#L340
нужно заменить на
$this->_ownerModel = CActiveRecord::model($ownerModel)->findByPk($key);
спс за отличное расширение
2012/02/16 17:46:33 [error] [exception.CHttpException.400] exception 'CHttpException' with message 'Некорректный запрос.' in /Users/max/Sites/myparty/www/yii/web/CController.php:1133
Stack trace:
#0 /Users/max/Sites/myparty/www/yii/web/filters/CInlineFilter.php(59): CController->filterAjaxOnly(Object(CFilterChain))
#1 /Users/max/Sites/myparty/www/yii/web/filters/CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain))
#2 /Users/max/Sites/myparty/www/yii/web/filters/CFilter.php(41): CFilterChain->run()
#3 /Users/max/Sites/myparty/www/yii/web/CController.php(1146): CFilter->filter(Object(CFilterChain))
#4 /Users/max/Sites/myparty/www/yii/web/filters/CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
#5 /Users/max/Sites/myparty/www/yii/web/filters/CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain))
#6 /Users/max/Sites/myparty/www/yii/web/CController.php(292): CFilterChain->run()
#7 /Users/max/Sites/myparty/www/yii/web/CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array)
#8 /Users/max/Sites/myparty/www/yii/web/CWebApplication.php(276): CController->run('postComment')
#9 /Users/max/Sites/myparty/www/yii/web/CWebApplication.php(135): CWebApplication->runController('comments/commen...')
#10 /Users/max/Sites/myparty/www/yii/base/CApplication.php(162): CWebApplication->processRequest()
#11 /Users/max/Sites/myparty/www/index.php(10): CApplication->run()
#12 {main}
REQUEST_URI=/comments/comment/postComment
HTTP_REFERER=http://myparty/user/profile/1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.