This topic is outdated, see this topic for the current guidelines.
Before making your first post
check all the forum sections to decide where your question should be posted
use the #yii-2-0 section for discussions and questions about Yii 2.0
use the #yii-1-1-x section for discussions and questions about Yii 1.1
for general topics, which are not related to a specific Yii version, we have the #general category
the language for posting in the above forums is English, if you want to post in your native language, you may find the right place to post in #yii-international
do not make duplicate posts on same or different forum sections
General guidelines
To get your problems solved effectively and promptly, we suggest you:
Describe clearly the problematic phenomenon.
Include information about your server/client environment in which you encounter the problem, such as Yii version, operating system, Web server, Web browser, etc.
Include code snippet reproducing the problem and try to make it as simple as possible to isolate the problem. People may simply be scared away at seeing hundreds of lines of code. (i.e. do not copy/paste whole controller, model or view files)
when posting code use the code button (</> on the editor toolbar) for better code readability
Restrictions for new users
Please note that the following restrictions are enforced in order to reduce the spam activities in this forum (sorry for the inconvenience):
in addition. new members should try to search for their problems in the forum or wiki first before posting (this will reduce the issues of repeating the same questions on and on and possibly getting more concept on how to solve these problems).
That is a very important point, especially for newbies. Many of them are pasting whole views’ or controllers’ code, while many developers on the contrary - are saying thank you, after seeing post containing a lot of code, without even briefly reading it.
Additional suggestions to the users who ask questions.
Give feedback when your problem has been solved.
When you’ve got an answer or a hint that is of help to you, you should give feedback.
Without your feedback, the one who answered will be uneasy wondering if he has proposed a right solution to you or not. Also the third persons who read your thread will feel the same and may not get much benefit from it.
Nobody knows the real answer but you … it’s unfair. You should share your experience.
Don’t be disappointed when you got no reply.
There may be many reasons why you got no reply to your question.
Your question might not have been stated clear enough.
Your question might have been too difficult to get a quick answer.
By an unlucky coincidence, those who are willing to answer your question might have overlooked your question.
Anyway, don’t be disappointed.
Revise your question and try ask again in the same thread.
Please don’t start a duplicated thread (even in other sub forums) by posting the same question.
I assure you that the community of Yii is really a friendly one.
Tip: when your question is related to an extension, try to post it on the official thread of the extension created by its author. The extension authors track these threads and your question has more chances of being replied there.
Virtually every extension related question should be asked in Extensions forum. Especially when extension’s author doesn’t start separate thread.
Don’t use extension’s page comment system to ask a support questions! It is meant to be for reporting bugs and enhancements only! Any question about, how extension work or ask for help in any problem should be addressed only in Extensions forum.
Pity, that most new users does not understand this, and shots extension supports question in general discussion forum or using extension’s page comment system.
If you’ve encountered a problem with JavaScript code, such as a dependent drop down, please perform the following preliminary debugging steps and include the information in your post.
[list=1]
[*] Open your browser’s developer tools and go to the console tab. Reload your page and see if you get any errors. In this case, there may be a problem with The JavaScript code on your page, maybe in a section unrelated to the issue that you’re trying to debug.
[*] With the console still visible, try to perform the action that triggers the JavaScript code. For a dependent drop down, this would entail changing the value of the first drop down list. Does this cause any errors?
[*] If your code is intended to communicate with the server, navigate to the network tab of your developer tools. Was the expected request sent to the server?
[*] If so, check the response. Did it return the response code and data that you expected? If not, is there an error message in the returned content that can help you to find the cause of the problem?
[/list]
You may find that the solution becomes obvious to you after following the steps above. Even if it doesn’t, this information will be very helpful to people on the forum, so please include the results in your original post.
A lot of issues like (empty data, not saved, is not a object, not defined …) could be solved (maybe by yourself) very quick if you do var_dump or debug.
It’s often hard to help without any knowledge of the data you are working with.
Maybe you don’t have to post a topic here and you really learn a lot:
Please ‘var_dump’ or ‘CVarDumper::dump()’ first like:
var_dump($_POST); //check submitted formdata, learn how Yii builds the form variables
CVarDumper::dump($_GET); //learn how Yii handles a gridview, paging ...
var_dump($_FILES); //problem with uploads
$data = ModelClass::model()->findAll();
var_dump($data); //check data
$data = $dataProvider->getData();
var_dump($data,$dataProvider); //array of models? or array only?
...
die();
If possible, install a debugger in your IDE.
Set a breakpoint inside the controller action that is called and step through the code. You can check ajax calls to the controller action too.
Step through the whole framework code if necessary.
You can learn a lot how Yii works:
how Yii handles the request/modules and components - start debugging in index.php
how the db request works (CDbCriteria, CommandBuilder…)
I would add some suggestion for the people that try to help users:
[list=1][] read carefully the request and firstly provide answer to the request and then eventually provide alternative solution, people ask "How do I print coffee?" and many times the answer is "Just print banana"[]take your time time to write a proper and clear answer, eventually read your text 3 times to be sure is all clearly explained[]avoid quick posting just to be the first to answer, it is not a competition about to be the first, is about to help people. The are some "helpers" that post multiple times consecutively 3 or 4 rows of text each answer and this does not help and make everything more confusing[]If possible always include reference to the manual, wiki, howto… Do not just copy and paste from the reference unless you provide more information from your own to complete the answer.[/list]