Wiki articles

Showing 61-80 of 145 items.

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

Created a year ago by s.oli, updated a year ago by samdark.

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: 12 967 times
Version: 2.0
Category: Tips

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:

1 0
3 followers
Viewed: 8 394 times
Version: 2.0
Category: Tips

Events registration examples

Created 7 months ago by minitia, updated 7 months ago by minitia.

Register an event handler at Object-Level

1 0
2 followers
Viewed: 13 540 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 4 years ago by Scott_Huang, updated 4 years ago by Scott_Huang.

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

1 0
5 followers
Viewed: 31 796 times
Version: 2.0
Category: Tips

Remove Byte Order Mark (BOM) from files recursively

Created 6 years ago by Kostas Apazidis (KonApaz), updated 8 months 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: 24 560 times
Version: all
Category: How-tos

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

Created 2 years ago by Amjad Khan, updated 2 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: 54 063 times
Version: 2.0
Category: Tutorials

My Own Components Folder in Yii2

Created 5 years ago by CTala, updated 5 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: 14 912 times
Version: 2.0
Category: Tips

Using your own forked version of extensions with composer

Created 5 years ago by Kartik V, updated 4 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: 16 719 times
Version: 2.0
Category: Tutorials

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

Created 6 years ago by Charles R. Portwood II, updated 5 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: 224 184 times
Version: 2.0
Category: Tutorials

Override/Eliminate Bootstrap CSS/JS for Yii 2.0 widgets

Created 5 years ago by Kartik V, updated a year 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: 42 929 times
Version: 2.0
Category: How-tos

FORM with GET method causes repeated stacking of URL Parameters

Created 5 years ago by Kartik V, updated 5 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: 45 535 times
Version: all
Category: Tips

Creating a Dependent Dropdown From Scratch in Yii2

Created 5 years ago by ThePr0f3550r, updated a year ago by alrazi.

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: 105 888 times
Version: 2.0
Category: How-tos

Simple way to implement Dynamic Tabular Inputs

Created 4 years ago by ezekielnoob, updated 8 months ago by samdark.

grid

2 0
10 followers
Viewed: 30 391 times
Version: 2.0
Category: Tutorials
2 0
3 followers
Viewed: 22 798 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 4 years ago by Scott_Huang, updated 4 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: 15 562 times
Version: 2.0
Category: Tutorials

A Single Page with a List and a Detail

Created 3 years ago by softark, updated 3 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: 18 682 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: 16 440 times
Version: 2.0
Category: How-tos

How to use BootstrapInterface

Created 5 years ago by Antonio Ramirez, updated 5 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: 13 739 times
Version: 2.0
Category: How-tos

Cómo enviar emails usando SMTP

Created 5 years ago by robregonm, updated 5 years ago by robregonm.
2 0
2 followers
Viewed: 17 078 times
Version: 2.0
Category: How-tos

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

Created 5 years ago by Kartik V, updated 5 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: 21 101 times
Version: 2.0
Category: Tips