Wiki articles in category How-tos

Showing 121-140 of 292 items.

Open Dialog from ajax content

Created 6 years ago by Touzas, updated 6 years ago by Touzas.

This is the code in the View.

<?php echo CHtml::link('MyDialog', Yii::app()->createUrl('site/page'), array('class' => 'openDlg divDialog')); ?>
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id'=>'divDialog',
	'options'=>array( 'title'=>Yii::t('Dialog Title', 'autoOpen'=>false, 'modal'=>true, 'width'=>600)));
?>
	<div class="divForForm"></div>
<?php
$this->endWidget(...
3 1
5 followers
Viewed: 20 030 times
Version: 1.1
Category: How-tos

Create sitemap.xml file dynamically on root folder with one hit

Created 6 years ago by kiran sharma, updated 6 years ago by kiran sharma.

I had created one controller file which can create sitemap.xml file(which is used for seo, google crawler and many other puropse) dynamically with one run.

2 1
9 followers
Viewed: 20 254 times
Version: 1.1
Category: How-tos
Tags: SEO, SiteMap, XML

Yii 1.1: How To add id or class to CMenu items ?

Created 5 years ago by Louis Gac, updated 5 years ago by Louis Gac.

CMenu comes with a lot of great customization options built in. One of the most used is the class 'active' being added to menu item. But, what if you want to add your own class or id to a menu item ?

1 0
1 follower
Viewed: 20 679 times
Version: 1.1
Category: How-tos

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

Created 7 years ago by pckabeer, updated 7 years ago by pckabeer.

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 [enumDropdownList](http://www...

6 0
3 followers
Viewed: 20 790 times
Version: 1.1
Category: How-tos

Using Grunt for deploying client scripts

Created 6 years ago by Chris83, updated 6 years ago by Chris83.

For a long time I have struggled to find a suitable tool for doing server tasks such as compiling LESS files, concatenating and minifying of JavaScript files and copying the minified JavaScript files. While most of these tasks can be done with Yii extensions I would still not recommend using them because it requires you to include these extensions in your project, and therefore also deploying them...

8 0
7 followers
Viewed: 20 849 times
Version: 1.1
Category: How-tos

Generate a multi-lever array sub-category for a menu

Created 6 years ago by Kostas Apazidis (KonApaz), updated 5 years ago by Kostas Apazidis (KonApaz).

Everyone have seen a multilayer menu in several CMS

6 0
8 followers
Viewed: 20 876 times
Version: 1.1
Category: How-tos

How to use Smarty renderer in Yii

Created 8 years ago by dongbeta, updated 8 years ago by dongbeta.

At first, create a class named SmartyRenderer under application/components or any directory you want.

3 0
7 followers
Viewed: 21 237 times
Version: 1.1
Category: How-tos

How to create the custom Drop-down using CHtml::dropDownList

Created 5 years ago by Ankit Modi, updated 5 months ago by samdark.

Hi Friends, This tutorial may be help us create the custom drop-down menu using CHtml::dropDownList

0 0
3 followers
Viewed: 21 478 times
Version: 1.1
Category: How-tos

Use CGridview to sort and filter CSqlDataProvider - when used with UNRELATED tables (or complex queries)

Created 4 years ago by Gerhard Liebenberg, updated 4 years ago by Gerhard Liebenberg.

I have two tables called hospitals and departments. I have a junction table between them which holds the departments in each hospital. But sometimes I need a list of "All hospitals with All possible departments" - regardless of whether they are linked in the junction table or not.

0 0
3 followers
Viewed: 21 644 times
Version: 1.1
Category: How-tos

get summary of related model via STAT relation

Created 5 years ago by rootbear, updated 5 years ago by YiiJeka.

typical scenario: invoice, invoice items.

4 1
8 followers
Viewed: 21 742 times
Version: 1.1
Category: How-tos

Insert a multirow header in CGridView

Created 6 years ago by Peppe, updated 4 years ago by Peppe.

The CGridView widget is very useful and customizable, but sometimes you need a little more. One limit I found is to have only one row for headers; yes, you can write each column header in more than one row, but just inside the single cell. I was looking instead for the possibility to use more than one row, with different structure one from the others. This way **you can write columns grouping h...

4 0
5 followers
Viewed: 21 759 times
Version: 1.1
Category: How-tos

CSV Export

Created 7 years ago by JohnPollard, updated 7 years ago by JohnPollard.

I needed a csv export function for my cgridview and I wanted to export the entire result set of the sorted and filtered cgridview the user was viewing via ajax.

4 0
5 followers
Viewed: 22 271 times
Version: 1.1
Category: How-tos
Tags: csv, export

Extending an ActiveRecord model

Created 6 years ago by Bogsey, updated 6 years ago by Bogsey.

protected $_viewFile

2 3
7 followers
Viewed: 22 431 times
Version: 1.1
Category: How-tos

ACL and RBAC

Created 7 years ago by zeroByte, updated 7 years ago by kevinkorb.

This HowTo assumes that you have a smattering of ACL in general and of how the acl-extension works basically. It will introduce you into the abstract and give you a hint on how to use Business-Rules. If you have in-depth questions, please refer to the extension documentation. Using ACL in an RBAC-manner cannot and should never obs...

0 0
4 followers
Viewed: 22 764 times
Version: 1.1
Category: How-tos

How to implement an event and attach it in a behavior

Created 6 years ago by seb7, updated 6 years ago by seb7.

This page explains how to implement an event and catch that event in a behavior.

2 0
9 followers
Viewed: 22 790 times
Version: 1.1
Category: How-tos

Login Form With email or Whatever

Created 5 years ago by nabil abdouali, updated 5 years ago by nabil abdouali.

Here is my solution to login with email or anything else This update works with database mysql You must generate the user model with GII

1 2
2 followers
Viewed: 22 806 times
Version: 1.1
Category: How-tos

Load the Yii-Bootstrap Extension on Specific Actions

Created 6 years ago by chuntley, updated 6 years ago by chuntley.

A big problem I've hit with the Yii-Bootstrap extension is that all AJAX requests are initializing Bootstrap because of preload. This is a huge waste of resources, especially when using AJAX-based file uploaders that split the file into chunks. Large file uploads using that method could be initializing bootstrap hundreds of times.

7 0
15 followers
Viewed: 23 191 times
Version: 1.1
Category: How-tos

Cheat Sheet: Displaying Name instead of Numbers and Displaying Alphanumeric instead of numeric values

Created 6 years ago by skworden, updated 6 years ago by skworden.

I keep a reference to some simple but painful task if you forget a common or something. I am new to Yii and this took awhile for me to figure out. Everything I read said do this or do that and not a single one worked for me. However, the following did.

3 1
6 followers
Viewed: 23 391 times
Version: 1.1
Category: How-tos

How to pass the third parameter to UserIdentity on login authentication

Created 4 years ago by Rohit Suthar, updated 4 years ago by Rohit Suthar.

In this wiki I will show how could wo pass the third parameter to UserIdentity on login authenticate. So we can do separate login authentcation from two or more different models from single login form.

1 0
5 followers
Viewed: 23 470 times
Version: 1.1
Category: How-tos