Dear all, I’m new with PHP and YIIFramework, so I’m trying to write the blog apps from scratch, and copy it step by step.
In a first few steps, everything goes OK, but when I came to the Post relation function, the browser just get not fount message. if I revert the relation function code to the code generated by system, and browser get OK again. so it must be the problem of this function, however I compared this function with demos/blog/protected/models/Post.php’s corresponding function, it’s identical.
And I found ,the problem is at the const value Comments::STATUS_APPROVED, if I replace this value with a numerical number, such as 1, the page could be viewed correctly.
So my question is how the blog demo works fine, but mine gets wrong?
I have configure the following parameters in config/main.php
16 ‘import’=>array(
17 ‘application.models.*’,
18 ‘application.components.*’,
19 ),