Wiki

Articles tagged with "widget"X
Displaying 1-10 of 10 result(s).

How to show a Captcha in CForm?

Created 3 months ago by Rohit SutharHow-tos0 comments – viewed 1,844 times – ( +3 / -1 ) – version 1.1
In this wiki I will show how could use a Captcha in yii CForm. The easy way to show captcha image is create a form using CHtml method & CActiveForm, but CForm also should be able to show a captcha.
tags: captcha, CForm, widget

Managing a star rating with the StarRating widget in Yii 2

Created 5 months ago by Kartik VHow-tos1 comment – viewed 2,084 times – ( +28 / -5 ) – version 2.0
In Yii 1.x, there was a built in widget CStarRating based on the jquery star rating plugin. There exists no prebuilt solution in Yii2, however the same concepts can be extended using any jquery plugin.

Managing your nested dropdown dependency with DepDrop widget

Created 5 months ago by Kartik VTutorials4 comments – viewed 3,607 times – ( +28 / -5 ) – version 2.0
If you are coming over to Yii 2 from Yii 1.x, you may have already read this useful wiki for creating dependent dropdowns. You can use a similar approach in Yii 2 to do the same. But if you are looking at a prebuilt solution that helps you manage it easier, read along.

How to store array/widget configuration to the database with config validation rules

Created 5 months ago by Kartik VTutorials0 comments – viewed 2,030 times – ( +29 / -4 ) – version 2.0
You may have scenarios, where you want to store a specific array configuration to the database. A classic example could be saving Yii widget configuration to the database and then retrieving it at runtime, with dynamic parameters set. This wiki discusses one of the approaches to do this. Let's consider you have something like the NavBar configuration below to store in the db:

How to read HTML5 Multiple File Input from controller?

Created 5 months ago by Kartik VHow-tos1 comment – viewed 1,790 times – ( +27 / -4 ) – version all
Ok, so you have a HTML 5 file input markup on your view and you have enabled multiple attribute to true. You may also be using widgets based on HTML5 input like \kartik\widgets\FileInput. But when you read a file in Yii controller using CUploadedFile (Yii1) or UploadedFile (Yii2), you do not see a list of multiple files that you selected in your view, but only one row. Your HTML markup in your view would be something like this and you don't know why this is not working?

How to use GridView with AJAX

Created 5 months ago by Antonio RamirezHow-tos1 comment – viewed 5,744 times – ( +5 ) – version 2.0
With the adoption of PJax on Yii2 things  have change quite a bit with GridView when it comes to work with them in AJAX mode. It will probably be confusing at the beginning, but then you will soon realize how powerful the new approach is.
tags: yii2, pjax, widget

Additional form data with XUpload

Created 2 years ago by AsgarothHow-tos7 comments – viewed 26,646 times – ( +9 ) – version 1.1
In this article you'll learn how to send additional form data when uploading files using XUpload widget

Extending CJuiDialog

Created 2 years ago by dstudioHow-tos0 comments – viewed 8,589 times – ( +2 / -2 ) – version 1.1
Sometimes you have CJuiDialog with different content but same buttons (or width, height). If you don't want to repeat yourself this is a great solution:

SEO-conform Multilingual URLs + Language Selector Widget (i18n)

Created 2 years ago by c@cbaTutorials35 comments – viewed 41,151 times – ( +29 ) – version 1.1
You have a multilingual application, and you want the URL of a page to be different for different languages, to account for SEO. The URL for the contact page for example should look like http://something.com/en/contact in english, and http://something.com/de/contact in german. This tutorial describes how to make it happen. Note that currently selected language is always a part of the URL, and thus available to the application through $_GET. You don't have to use sessions variables to keep track of the language if you don't want to.

How to create nice modal login widget with a CJuiDialog

Created 3 years ago by Igor IvanovicTutorials3 comments – viewed 42,691 times – ( +9 ) – version 1.1
...folder /protected/components/UserLoginWidget.php... ...extending the CWidget class...
tags: user, login, modal, widget