Hello everybody
Sorry for my bad english.
I started a new website with Yii. It's a pretty cool framework with a lot of possibility. I previously worked with Zend Framework, Code Igniter or Cake PHP but Yii are my favorite.
I have some questions.
-
I do not really understand how working Events with onSomething function. Where could I find a complete exemple ?
-
I want to creat a global control of my application. In each controller I have the same 2 methods: actionAdd and actionList. Only authorized user could use this methods. I want to use "Role-Based Access Control" but the controll need to be execute before or after each routing because I don't want to write the same filter in each controller. In Cake Php you need to creat a file called app_controller.php to the root of your application with two methods: beforeFilter() and afterFilter(). In Zend Framework you could creat Plugin with preDispatch() and postDispatch method. This plugin are include in the workflow in the bootstrap. My question are: how I could do that with Yii: I must create a global controller (with filter) which inherits the controller of my application or there is an other way ?
-
My last question. I use CHtml::activeLabel to creat my form. The problem are the following: my models are in english but my website are in french. My label are also display in english and my error message are a mix beetwen the both ("Name ne peut être vide" with "Name" in englsih and "ne peut être vide" in french) How I could translate model attribute ?
I try to post in english because the french topic are not realy alive. But I will translate my post and your response to resurrect it.
Thanks a lot.