Wiki articles in category Tips

Showing 21-40 of 162 items.

Set a menu - reusable code

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

As we know Using crud generator creates menu items in view files (for each view file have a varius menu items)

1 0
3 followers
Viewed: 11 417 times
Version: Unknown (update)
Category: Tips

Yiistrap TbHtml::navbarSearchForm

Created 10 years ago by Patrice, updated 10 years ago by CeBe.

Hi all,

0 0
3 followers
Viewed: 18 356 times
Version: 1.1
Category: Tips

REST API and null values in XML

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

I have been working on a REST API using the excellent tools provided by Yii2. My problem was that I have to differentiate between empty values and null values. In other words, <elem></elem> is different from null as it represents an empty string. Also, although some use <elem/> to represent a null value it should still be interpreted as an empty string. In other cases, the absence of the eleme...

0 0
0 follower
Viewed: 19 530 times
Version: 2.0
Category: Tips
Tags: null, REST, XML

Reading the doc

Created 13 years ago by zaccaria, updated 13 years ago by Orteko.

Almost all the information you need whilst working with yii is written in the Class Reference.

21 0
3 followers
Viewed: 12 424 times
Version: 1.1
Category: Tips
Tags: doc

Extending CActiveForm for some form display fixes and language tweaks

Created 13 years ago by Trejder, updated 13 years ago by Trejder.

In this simple example I'll demonstrate how to extend CActiveForm class to overload some drawing functions to achieve some commonly used fixes in forms.

The colon

Here is overloaded version of CActiveForm.labelEx that adds colon (:) at the end of text of label with respecting CHtml::$afterRequiredLabel and CHtml::$beforeRequiredLabel

5 0
6 followers
Viewed: 23 982 times
Version: 1.1
Category: Tips

Yii behind a reverse proxy, SSL support and correct IP logging

Created 11 years ago by mrkmg, updated 11 years ago by mrkmg.

If you are hosting Yii behind a reverse proxy, for example nginx, and you are having issues with your logs showing the proxies IP, or the urls being created arn't being created for SSL because your SSL certs are located on your reverse proxy instead of the Yii server, this code may be able to help you. I placed them in the very top of Yii's entry script, index.php

0 0
2 followers
Viewed: 17 908 times
Version: 1.1
Category: Tips

Custom Archive in Blog system

Created 11 years ago by nirmalroka, updated 11 years ago by nirmalroka.

Hi I had made simple archive system for blog system that can handle tbl_post. I had used simple CDbCriteria not more than that. I know there is more and many better way to this but I think this will give some idea to users to generate new idea or customized or modified this version of code.

1 0
2 followers
Viewed: 10 256 times
Version: 1.1
Category: Tips

ChromePHP for Yii

Created 13 years ago by imehesz, updated 13 years ago by imehesz.

ChromePHP is a console logging extension for Google Chrome.

3 1
4 followers
Viewed: 18 296 times
Version: 1.1
Category: Tips

Get notified about the status of a Facebook user in your web app using periodic Ajax calls.

Created 11 years ago by sirin k, updated 6 years ago by Maurizio Domba Cerin.

hello,

 This article is helpful only if you have the following situation:
 A web app which uses facebook login to login its users and if a user is logged out from his/her facebook account through another browser tab, then your app dont know that he is logged out  out or not from his facebook account and he/she will remain as logged in your web application.Its ok if you have no problem wi...
4 0
6 followers
Viewed: 15 623 times
Version: 1.1
Category: Tips
Tags: facebook, user

Extending common classes to allow better customization

Created 13 years ago by Steve Friedl, updated 13 years ago by Steve Friedl.

The two most commonly-used base classes in most Yii applications are CController and CActiveRecord, each extended to your own particular models and controllers.

36 0
19 followers
Viewed: 41 368 times
Version: 1.1
Category: Tips
Tags:

Solution for session lose of Facebook iframe application in Internet Explorer .

Created 11 years ago by sirin k, updated 6 years ago by Maurizio Domba Cerin.

Facebook iframe app’s session is losing in Internet Explorer when doing a second redirection inside the facebook iframe app.The main reason is ,by default IE wont allow cookies in its priavacy settings If cookies not available means session is also not available for our Facebook iframe app in IE.

2 0
4 followers
Viewed: 14 406 times
Version: 1.1
Category: Tips

An important tip when you are using CArrayDataProvider.

Created 11 years ago by sirin k, updated 6 years ago by Maurizio Domba Cerin.

Yii's CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an...

5 1
5 followers
Viewed: 19 744 times
Version: 1.1
Category: Tips

Auto-update denormalized attributes with MongoDb and Yii2

Created 10 years ago by edoardo849, updated 10 years ago by CeBe.

You have different collections in MongoDb with de-normalized attributes. As you may know, due to its not-join nature, MongoDb tends to encourage repetition of the same value in different collections (de-normalization). In this MongoDb is opposed to a more SQL-like approach where you usually reference only the ID of the value with a foreign key.

1 0
3 followers
Viewed: 17 602 times
Version: 2.0
Category: Tips

[pt-br] O guia de estudos do Yii para iniciantes

Created 11 years ago by Rodrigo Coelho, updated 11 years ago by Rodrigo Coelho.

You can find the english version of this wiki here: The complete beginner's study guide for the Yii Framework.

1 0
3 followers
Viewed: 13 845 times
Version: 1.1
Category: Tips
Tags:

Setting static modules' properties in config

Created 11 years ago by Alexander Palamarchuk, updated 11 years ago by Alexander Palamarchuk.

You may face a situation when you need to access to a configurable module's property from everywhere and you don't have an instance of this module's class.

1 1
2 followers
Viewed: 14 246 times
Version: 1.1
Category: Tips
Tags: config, module

My Own Components Folder in Yii2

Created 9 years ago by CTala, updated 9 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: 20 804 times
Version: 2.0
Category: Tips

Locking your Yii 2 project package versions with composer.lock

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

Ok, you have installed a Yii 2 basic or advanced app for the first time and completed the post install steps. You have picked up a few extensions to install for the first time as well. You would already see a composer.lock file in your application root folder.

0 2
37 followers
Viewed: 16 602 times
Version: 2.0
Category: Tips

Install specific Yii2 vendor extension & dependency without updating other packages.

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

The tips here are for advanced usages of composer and its assumed you have read about using composer and have a knowledge of your vendor packages to be updated. Let's consider, you want to update only one specific yii2 vendor library, without updating all the other extension packages?

2 3
39 followers
Viewed: 43 318 times
Version: 2.0
Category: Tips

Speedup unit tests by moving MySql data to memory (in Ubuntu)

Created 11 years ago by seb, updated 11 years ago by François Gannaz.

There are several ways to speedup slow unit tests which interact with database:

1 1
3 followers
Viewed: 22 651 times
Version: 1.1
Category: Tips

Make an ajax request to another server using JSONP

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

There are cases that you want to make an ajax request to another server and get the results.

1 0
2 followers
Viewed: 13 767 times
Version: 1.1
Category: Tips