Wiki

Articles tagged with "actions", sorted by ratingX
Displaying 1-3 of 3 result(s).

A simple action for CJuiAutoComplete

Created 3 years ago by tydeas_drTips9 comments – viewed 28,361 times – ( +16 / -1 ) – version 1.1
More or less I use auto-complete field for a form. CJuiAutoComplete is a yii widget for this purposes. The common use case is to make an ajax request and retrieve a list from the database. So in this case you have to write a controller action to return you a json encoded list. What if I had a generic action to do this work for me?

How to use a component before every action of a controller

Created about a year ago by transistorTips1 comment – viewed 17,072 times – ( +2 / -1 ) – version 1.1
I guess this is a tip on how to execute some code before every action in a controller, because I will tell you how I did it and maybe you can use the idea in your project.

embed a view file of the class which implement the CAction.

Created 3 years ago by DavidhhuanTutorials1 comment – viewed 6,761 times – ( +1 / -1 ) – version 1.1
In Yii, we can define an action class and ask the controller to instantiate it. And we always create ourselves actions class in rootPath/protected/extensions, and the view file we called in the actions class always are located in rootPath/protected/views/ControllerNAME or rootPath/themes/ThemeNAME/ControllerNAME, then when we use the same actions class in different controllers, we have to copy it from one controller to the other controller, so we also need the "same" view file work for us, here is an example.
tags: actions, render, views