Comments (13)
Hi, by default I have the following order of comments - link
All oldest replies of comments at first
from yii2-comments.
Thats how I would like it to be, but this is what Im getting - link
from yii2-comments.
You need to create your own CommentModel and override getTree
method with the custom sorting
from yii2-comments.
What MySQL version do you use?
from yii2-comments.
I am using PostgreSQL 9.5.6, so I need to override the CommentModel, use the yii2mod\comments\models\CommentModel as the base and extends from it, then override the getTree to make my custom sorting, right?
from yii2-comments.
yes, you right. After that, you need to override commentModelClass
in the CommetModule by the following code:
'modules' => [
'comment' => [
'class' => 'yii2mod\comments\Module',
'commentModelClass' => 'path to your custom CommentModel',
],
]
from yii2-comments.
Okay, Thank you for your answers. By the way, the problem that your default sort is different than mine is because I use postgresql and you mysql? That makes no sense to me
from yii2-comments.
I agree with you, but I don't know why comments in our projects have different sorting.
from yii2-comments.
Well, I'm going to override it and work on it and if I find out why we have different sorting I'll let you know.
from yii2-comments.
Ok, thanks!
from yii2-comments.
I added order to getTree
. Can you update your package to dev-master
version and check it again?
from yii2-comments.
Yea this way it works as it has to!
from yii2-comments.
Cool, thanks!
from yii2-comments.
Related Issues (20)
- При переопределении имени таблицы в своей модели не работает менеджмент
- Не работает с включенным чпу HOT 1
- Default comment status
- Initialization problem: No new migrations found. Your system is up-to-date. HOT 1
- Problem with the encoding of the createComment using CommentWidget
- Are you accepting PRs at the moment? HOT 1
- Fail migrate m161114_094902_add_url_column_to_comment_table
- 404 - Create Comment Not Found HOT 1
- How to know count of comments from relatedTo ?
- Collaboration with https://docs.infiniteajaxscroll.com/
- No Reason Phrase HOT 7
- How to update entity model using event afterCreate? HOT 1
- API availability.
- "Carbon 1 is deprecated" warning HOT 3
- When is the next release planned? HOT 3
- Do you take donate? HOT 2
- Add attachments and editor
- Readonly Comments Feature
- Reinitialize the javascript methods HOT 2
- Не накатываются миграции HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-comments.