Wiki articles

Showing 61-80 of 142 items.
Created 7 months ago by s.oli, updated 6 months ago by samdark.

How to organize Design "things" in Yii 2 (themes and layout)

Sometimes the App needs a nicer look & feel, so its necessary to organize the assets for this and Yii can help a lot to make it easy. In this article I provide tips for handling multiple "Designs". I use these three features:

1 0
2 followers
Viewed: 8 190 times
Version: 2.0
Category: Tips
Created 4 years ago by yiqing95, updated 4 years ago by yiqing95.

embedded javascript block in your view with IDE checking or intellisense

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

1 0
3 followers
Viewed: 7 827 times
Version: 2.0
Category: Tips
Created 10 days ago by minitia, updated 10 days ago by minitia.

Events registration examples

Register an event handler at Object-Level

1 0
2 followers
Viewed: 645 times
Version: 2.0
Category: How-tos
Tags: events, yii2
Created 4 years ago by Scott_Huang, updated 4 years ago by Scott_Huang.

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

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

1 0
5 followers
Viewed: 27 612 times
Version: 2.0
Category: Tips
Created 4 years ago by johonunu, updated 4 years ago by johonunu.

Debuging variables in Yii2

This tutorial is explained following "basic" application structure.

2 1
6 followers
Viewed: 22 082 times
Version: 2.0
Category: Tips
Created 5 years ago by Kostas Apazidis (KonApaz), updated 2 months ago by samdark.

Remove Byte Order Mark (BOM) from files recursively

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
8 followers
Viewed: 23 211 times
Version: all
Category: How-tos
Created 4 years ago by CTala, updated 4 years ago by CTala.

My Own Components Folder in Yii2

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: 13 960 times
Version: 2.0
Category: Tips
Created 4 years ago by Kartik V, updated 3 years ago by Kartik V.

Using your own forked version of extensions with composer

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: 15 197 times
Version: 2.0
Category: Tutorials
Created 5 years ago by Charles R. Portwood II, updated 4 years ago by Vivek.

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

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: 213 978 times
Version: 2.0
Category: Tutorials
Created 5 years ago by Kartik V, updated 11 months ago by CeBe.

Override/Eliminate Bootstrap CSS/JS for Yii 2.0 widgets

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: 40 688 times
Version: 2.0
Category: How-tos
Created 4 years ago by Kartik V, updated 4 years ago by toph.

FORM with GET method causes repeated stacking of URL Parameters

// 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: 41 699 times
Version: all
Category: Tips
Created 3 years ago by Wade Shuler, updated 3 years ago by samdark.

[Guide] How to actually separate Frontend (User) and Backend (Admin) on Yii2 Advanced

I am writing this guide because I struggled to find a resource that included ALL of the necessary steps to completely separate the frontend from the backend. After reading guides like Configuring different sessions for backend and frontend in yii-advanced-app and [yii2 configuring d...

3 1
15 followers
Viewed: 76 076 times
Version: 2.0
Category: How-tos
Created 4 years ago by ThePr0f3550r, updated a year ago by alrazi.

Creating a Dependent Dropdown From Scratch in Yii2

I have read http://www.yiiframework.com/wiki/24/creating-a-dependent-dropdown/ (Dependen Dropdown Yii1), but I can't implement it in Yii2 because Yii2 does not have built-in AJAX functionality hem.. I searched about it and came across this post

3 1
11 followers
Viewed: 97 504 times
Version: 2.0
Category: How-tos
Created 3 years ago by ezekielnoob, updated 2 months ago by samdark.

Simple way to implement Dynamic Tabular Inputs

grid

2 0
11 followers
Viewed: 28 465 times
Version: 2.0
Category: Tutorials
2 0
3 followers
Viewed: 20 721 times
Version: 2.0
Category: How-tos
Created 3 years ago by Scott_Huang, updated 3 years ago by Scott_Huang.

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

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: 14 502 times
Version: 2.0
Category: Tutorials
Created 3 years ago by Bizley, updated 3 years ago by Bizley.

Simple revealing and hiding the password in the password field

There are numerous usability problems:

2 0
4 followers
Viewed: 13 754 times
Version: 2.0
Category: How-tos
Created 2 years ago by softark, updated 2 years ago by Patrick Jones.

A Single Page with a List and a Detail

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
4 followers
Viewed: 14 112 times
Version: 2.0
Category: How-tos
Created 2 years ago by Amjad Khan, updated 2 years ago by Amjad Khan.

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

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 0
6 followers
Viewed: 47 094 times
Version: 2.0
Category: Tutorials
Created a year ago by shiv, updated a year ago by shiv.

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

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: 14 483 times
Version: 2.0
Category: How-tos