We are going to deploy the new yiiframework.com website on March 23, 2018 from 8:00 to 12:00 UTC.
Website and Yii documentation will not be available in this time frame. Check the news for more details.


Articles in category "how-tos", sorted by ratingX
Displaying 131-140 of 355 result(s).

Radio Button List with enum values for column of type ENUM >+> incorporate into giix

Created 5 years ago by pckabeerHow-tos1 comment – viewed 19,175 times – ( +7 / -1 ) – version 1.1
Let's say our table 'mug' has a column named 'color' of the type ENUM('red','green','blue'). We want to replace the textfield for the attribute color in the create and update forms of a 'mug' with a Radio Button List, which has the enum values as options. This is a rewrite of c@cba in the wiki article of enumDropdownListThe main code was contributed by zaccaria in the forum (see this post).

How to render a view in Fancybox using ajax

Created 5 years ago by rix.rix.How-tos1 comment – viewed 24,134 times – ( +7 / -1 ) – version 1.1
Sometimes you want to render a view in Fancybox.
tags: fancybox, ajax, views

Elementary introduction to using jQuery ajax and the yii framework

Created 5 years ago by dhimesHow-tos4 comments – viewed 41,345 times – ( +7 / -1 ) – version 1.1
In doing internet searches trying to learn how to incorporated ajax into web pages generated by the yii framework I noticed that there seems to be a lot of confusion. I worry that too-clever hacks will be broken in upgrades of the framework.
tags: AJAX

Yii2 and Pdf files with Mpdf

Created 3 years ago by CTalaHow-tos2 comments – viewed 18,616 times – ( +7 / -1 ) – version 2.0
I am still new to composer and packagist, so I want to share how I am creating the pdf files because for me was not as simple as it should be.

Handling Bootstrap active tabs in Yii via URL

Created 5 years ago by JamesBarnsleyHow-tos17 comments – viewed 29,397 times – ( +7 / -1 ) – version 1.1
I (www.jamesbarnsley.com) found that when using the Yii Bootstrap tabs component you will sometimes want to direct the user to a specific tab and not necessarily the first tab. Yii Bootstrap already provides the "active" variable so you can define whether the tab is the active tab or not in PHP. I generally find though that a PHP solution to this problem is rather cumbersome as every tab component will need the PHP code inserted or you will have to extend the tab component somehow to do it.

Using Pear Mail Mail_Mime and Mail_Queue

Created 6 years ago by LorenHow-tos2 comments – viewed 12,240 times – ( +7 / -1 ) – version 1.1
Create a component (/protected/components/PearMail.php) Edit this as needed based on where you put the files from PEAR.

How to get & store Last Login DateTime in database?

Created 3 years ago by Rohit SutharHow-tos2 comments – viewed 15,584 times – ( +7 / -1 ) – version 1.1
In this wiki I will show how could be store last login date & time in database. First we need a field LastLoginTime (Type must be datetime). this field store a user login detalis (like - Date & Time).

Yii2: Configuring different sessions for backend and frontend in Yii Advanced Application Template

Created 3 years ago by hrnairHow-tos2 comments – viewed 27,388 times – ( +7 / -1 ) – version 2.0
This is as an extension of this wiki by Kartik V which shows to make different enableAutoLogin cookies for frontend and backend.

Storing your images in your table's blob field and displaying that stored images.

Created 5 years ago by sirin kHow-tos7 comments – viewed 35,759 times – ( +9 / -2 ) – version 1.1
He im giving you a very simple example ie how you can store an image to your blob field in a table.Hope you already familiar with the normal image upload.
tags: blob, image

Escape from Default's Yii2 Delete Confirm Box

Created 3 years ago by Antonio RamirezHow-tos9 comments – viewed 28,338 times – ( +9 / -2 ) – version 2.0
If you started playing with Yii2's new GridView, you will soon realize that some things have improved quite a lot, but I am sure its going to be a bit confusing at first glance when you try to modify certain javascript behaviors like for example, its delete confirmation dialog box.