I apologize for what might seem like a very noob question, but this is my first time using any php framework. I am getting quite lost in regards to a lot of concepts. I am building a web application that is basically an interface for employees(unauthenticaed users READ) and managers (admins Create Read Update and Delete) data from several different tables.
I’ve been able to create a “CRUD” using the gii tool, building a default view (boxes containing some of the fields which I do not care for) and an admin view for editing using my model.
What I would like to to do is make the searching/managing view found on the "Manage Modelname" operation, accessible to all regular users, but without the ability to update or delete. However, I would still like the detailed view icon to be accessible. I would like to of course retain the former actions to admin users.
On a related note, could anyone point me in the right direction in regards to how to set a default position of the pagination on a page load? Such as having the last records on a model appear, rather than id’s 1-10. That and how I can set the number of rows I would like to be contained in a page.
If you generated the CRUD with GII, take a look at the accessRules() function. just add the actions you want everyone to use to ‘all users’ section.
Look at CPagenation(sp?) component. I believe there is a property for the offset to display. For the last records, you calculate how many pages there will be and show the last one, or in the model change the sort order to DESC on the specific filed. Then you would show for example 23-3. The paginagtion component also has properties for setting the number of items per page.