I have created and configured a module fooModule. I need to create a component inside the module. This is my configuration for my module in main.php In the folder module fooModule i have created a folder components with a file testComponent.php TestComponet.php has a class test which extend yiibaseComponent. See below How do i access test class in fooModule Controller
Tag: yii2
Default Filter in GridView with Yii2
I don’t know how to set the filter default of GridView. It’s mean when page loaded, it’s will load the filter with specific condition that I’ve set. Any idea for this? Thanks
Yii2 : how to cache active data provider?
In my PostSearch model I have this code : my try, instead of above line return $dataProvider, would be this block of code: I would like to cache the result returned by ADP, based on the updated_at field. I mean I want to serve data from cache until some change is made. My code does not work, I mean caching
Yii 2 Menu Display List Depending on User
How do I configure or customize my Menu where in, for example, if I am an admin user, I can see everything on my navigation bar, like, in my case, the Users (list of Users where I can create, update, …
Get the name of the user in yii2
How can I get the name of the logged-in-user in yii2? I can get the user-id with Yii::$app->user->id; and I know that I could find the name in the database but I want a direct way. The name-…
Yii2 Multiple instances of the same model
I want to get multiplie instance of the same model in my controller. I saw this wiki for Yii 1.1 and tried like that but in my code only last instance in form was acceble from controller my code is here (I commented code with error and variable values): It is my form view in _form.php: It is log result
yii2 installation – migrate command not working
I am trying to install yii2 in ubuntu. yii2 migrate command not working yii migrate I am getting Below error php yii /var/www/event-tracking/migrate PHP Deprecated: Comments starting with ‘#’ …