Wiki articles

Showing 61-80 of 147 items.

Events registration examples

Created a year ago by minitia, updated a year ago by minitia.

Register an event handler at Object-Level

1 0
2 followers
Viewed: 43 583 times
Version: 2.0
Category: How-tos
Tags: events, yii2

Easy way to redirect http:\\localhost\yii2-basic to http:\\localhost\yii2-basic\web\index.php

Created 5 years ago by Scott_Huang, updated 5 years ago by Scott_Huang.

First of all, install yii2 basic template according below link:

1 0
5 followers
Viewed: 39 146 times
Version: 2.0
Category: Tips

Remove Byte Order Mark (BOM) from files recursively

Created 6 years ago by Kostas Apazidis (KonApaz), updated a year ago by samdark.

The problem was that all my web applications ran normally on localhost, but on server the Greek characters (or any other no-english characters) displayed with problems.

2 1
7 followers
Viewed: 26 597 times
Version: all
Category: How-tos

Yii2 GridView Sorting and Searching with a Junction Table Column(Many to Many Relationship)

Created 3 years ago by Amjad Khan, updated 3 years ago by Amjad Khan.

Following is the table structure

tblgroups

CREATE TABLE IF NOT EXISTS `tblgroups` (
  `id` int(11) NOT NULL,
  `groupname` varchar(150) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Acitve,2=Inactive',
  `date` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

tblcontacts

2 1
6 followers
Viewed: 63 616 times
Version: 2.0
Category: Tutorials

My Own Components Folder in Yii2

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

In Yii1 I used to have my own components under the components folder of the structure, now with namespacing this is a little bit different.

2 1
2 followers
Viewed: 15 810 times
Version: 2.0
Category: Tips

Using your own forked version of extensions with composer

Created 6 years ago by Kartik V, updated 5 years ago by Kartik V.

So you want to use a fork of any existing vendor extension with your Yii 2 install and use the fork, instead of original source. This does not need you to push any update or register your package on packagist.org. You are recommended to follow the approach below:

3 2
40 followers
Viewed: 18 378 times
Version: 2.0
Category: Tutorials

Creating a Simple CRUD App With Yii2 (Revised 12/20/2013)

Created 7 years ago by Charles R. Portwood II, updated 6 years ago by Vivek.

By popular demand, today I will be revisiting my previous Yii Framework 2 Getting Started Guide and updating it with what is currently available in the Yii Framework 2 Repository. Provide here is an super simple example CRUD application that will help you get started using the framework.

7 6
21 followers
Viewed: 245 391 times
Version: 2.0
Category: Tutorials

Override/Eliminate Bootstrap CSS/JS for Yii 2.0 widgets

Created 6 years ago by Kartik V, updated 2 years ago by CeBe.

An example of customizing the Yii GridView is mentioned here. You can easily override Bootstrap or other styling defaults by changing the GridView default options.

4 2
39 followers
Viewed: 45 976 times
Version: 2.0
Category: How-tos

FORM with GET method causes repeated stacking of URL Parameters

Created 6 years ago by Kartik V, updated 6 years ago by toph.

// In Yii 1.x $form = $this->beginWidget('CActiveForm', [

'id' => 'order-search-form',
'method' => 'get',

]); echo $form->textInput($searchModel, 'id'); echo CHtml::submitButton('Find', ['class' => 'btn btn-primary']); $this->endWidget(); `

4 2
40 followers
Viewed: 49 741 times
Version: all
Category: Tips
2 0
3 followers
Viewed: 24 848 times
Version: 2.0
Category: How-tos

Export query content to excel through any of your controllers, also can set cssClass for header/odd/even rows, auto download

Created 5 years ago by Scott_Huang, updated 5 years ago by Scott_Huang.

To generate excel by query content, and download through any controller. You also can bind cssClass to header/odd/even rows. As for header, you even can set cssClass for each column.

$this->export2excel($excel_content,$excel_file);

in your controller.

2 0
2 followers
Viewed: 17 266 times
Version: 2.0
Category: Tutorials

A Single Page with a List and a Detail

Created 4 years ago by softark, updated 4 years ago by Patrick Jones.

The CRUD generator of Gii has done a wonderful job for you, and you already have a list of items in the "index" page and a detailed view of a specified item in the "view" page.

2 0
3 followers
Viewed: 23 195 times
Version: 2.0
Category: How-tos

How to get SEO friendly URL using Model and new getUrl() function

Created 2 years ago by shiv, updated 2 years ago by shiv.

We all need SEO friendly URLs for our projects. its not always good to call route with params so we can generalise it for all models using a common function.

2 0
1 follower
Viewed: 19 388 times
Version: 2.0
Category: How-tos

How to use BootstrapInterface

Created 6 years ago by Antonio Ramirez, updated 6 years ago by Antonio Ramirez.

Yii2 introduces the BootstrapInterface to ease our application initialization tasks, whether they are composer based or Application bootstrap (do not mistaken with Bootstrap CSS Framework) based tasks. On this article, I am going to explain how to use it on y...

2 0
3 followers
Viewed: 14 862 times
Version: 2.0
Category: How-tos

Cómo enviar emails usando SMTP

Created 6 years ago by robregonm, updated 6 years ago by robregonm.
2 0
2 followers
Viewed: 19 924 times
Version: 2.0
Category: How-tos

Yii2 default values for Index data Provider

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

Guys,

2 0
5 followers
Viewed: 26 605 times
Version: 2.0
Category: Tips

Key web server settings after installing a fresh Yii 2 basic or advanced app

Created 6 years ago by Kartik V, updated 6 years ago by Kartik V.

So, you have installed a brand new Yii 2 app (basic) or (advanced). Here are a few tips for Apache web server users to get things running more secure and better with your yii2 app.

2 0
45 followers
Viewed: 22 515 times
Version: 2.0
Category: Tips

How to use yii2-authclient to communicate with Twitter using Single Access Token

Created 6 years ago by Antonio Ramirez, updated 6 years ago by Antonio Ramirez.

It is quite simple, but I am sure this small tutorial will help more than one of you out there :)

2 0
4 followers
Viewed: 20 647 times
Version: 2.0
Category: How-tos

embedded javascript block in your view with IDE checking or intellisense

Created 5 years ago by yiqing95, updated 5 years ago by yiqing95.

this is my way for embed js code block in view file:

2 0
3 followers
Viewed: 9 231 times
Version: 2.0
Category: Tips

Using Nginx and Apache2 in separate distributed servers (ie, Amazon EC2 instances)

Created 7 years ago by Luis Lobo Borobia, updated 3 years ago by Luis Lobo Borobia.

We are running one frontend running NGINX and several app servers running Apache2. There are several issues we have come across but right now I'll be documenting one of them. I'll be completing this article when I get more time.

2 0
2 followers
Viewed: 9 860 times
Version: all
Category: Tips