Completely lost

Hello,

Sometimes I do see a message of a newbie. Well, I appear to be not even a newbie, I got lost in the Yii framework. I do have a PHP MySql application for a soccer club and other applications. Build from scratch, so a framework is very welcome. Yii appears to be a perfect choice. But I cannot get any data from a form via the POST method to a next page. Should be the simplest, but the documentation gives me no clue at all. And I am definitely no OO specialist. So, should I leave Yii again so soon? Or has anyone a normal understandable answer. My first not working try is:

  1. Read data from a database via “SHOW COLUMNS FROM ‘docs’” and “SELECT * FROM ‘docs’” (works)

  2. Present is as a table (works)

  3. Click on the column header to change the order string of the sql query with javascript

    (works, I made the input field visible)

  4. Submit the form/page to be rendered again via its controller.

It works, but the new order string is lost, so the table order is not rearranged.

I believe the solution is so simple and I am making a stupid mistake. But what mistake?

Thanks!!

probably most things you are looking for is implemented at Yii Blog tutorial:

http://www.yiiframework.com/demos/blog/

and here how things are done:

http://code.google.com/p/yii/source/browse/#svn/trunk/demos/blog

If your requirement is to have the list sorted in a particular order, you can do that when you define the relation:




public function relations()

    {

        return array(

            'posts'=>array(self::HAS_MANY, 'Post', 'author_id',

                            'order'=>'posts.create_time DESC',

                            'with'=>'categories'),

            'profile'=>array(self::HAS_ONE, 'Profile', 'owner_id'),

        );

    }



If you are trying to maintain the sort order as the user clicks, you can try to pass the column and sort order as a url parameter

@PrplHaz4. Your last sentence is correct, I want the user to set the order string.

@Flavio. Thanks, I found in the code files the form model and the way to declare fields without specific requirements. Suddenly I saw the (indeed simple) solution. I did not declared the order string I wanted to change by the user. Now I go on to base my application TeamNet on the Yii framework.