Wiki

Articles in category "tips", sorted by ratingX
Displaying 71-80 of 154 result(s).

Putting Function To Be Called In View

Created 6 years ago by junxiongTips2 comments – viewed 36,945 times – ( +6 / -2 ) – version 1.1
Sometimes we need some complicated view to be displayed (such as generating complicated table). Most people suggest that in MVC the View must be as simple as possible (don't have too much loops, etc). So what we have to do is to hide away the complex code by putting it at somewhere else. The following are few places options to keep the function:
tags: view, render

Managing constants easily

Created 5 years ago by briiC.lvTips4 comments – viewed 17,517 times – ( +4 / -1 ) – version 1.1
For time to time i have models with constants (basicly status constants) which i use in diferent places and if these constant changes, i have to change mentions of constant in code elsewhere.

Create thermometer using rgraph

Created 4 years ago by Ankit ModiTips2 comments – viewed 7,775 times – ( +4 / -1 )
Hi friends,

How to catch and log MySQL deadlock errors

Created 5 years ago by sebTips1 comment – viewed 13,219 times – ( +4 / -1 ) – version 1.1
This method allows to log InnoDB monitor output when deadlock error occured. This way we will have much more useful data to find and fix deadlock.
tags: database

Access log output from unit tests

Created 5 years ago by MikeTips2 comments – viewed 8,462 times – ( +4 / -1 ) – version 1.1
Say, you want to write a test for a component which provides a caching feature. How would you know, that some method of your component returns a cached result? With the solution described here you can inspect all log outputs. So you could search the logs for accesses to the DB to really make sure, that the result was served from cache.

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

Created 5 years ago by sirin kTips0 comments – viewed 8,021 times – ( +4 / -1 ) – version 1.1
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 with this situation.But if you want to forcefully logout the user from your application if he is logged out from his facebook account means you can try this example.This example uses periodic ajax calls to facebook's graph api to check whether the user is logged in or not.
tags: facebook, user

Preventing CJuiTabs from hiding drop-down CMenu items

Created 6 years ago by Steve FriedlTips1 comment – viewed 11,128 times – ( +4 / -1 ) – version 1.1
Almost all Yii applications use CMenu at the top of each page to show options available to the user, and many include drop-down components to allow more fine-grained selection.

Yii2 default values for Index data Provider

Created 3 years ago by CTalaTips3 comments – viewed 18,746 times – ( +4 / -1 ) – version 2.0
Guys,

Syntax check

Created 6 years ago by Russell EnglandTips2 comments – viewed 9,007 times – ( +4 / -1 ) – version 1.1
So I've been busy making lots of modifications to my views/models/controllers - came to test the app and got a blank screen. Nothing in the application.log file so must be a syntax error somewhere... But which file?
tags: php, syntax

adding class and links to Ctreeview node

Created 6 years ago by bingjie2680Tips2 comments – viewed 15,123 times – ( +4 / -1 ) – version 1.1
This article will show you how to add links and class to each node in ctreeview. so you can attach events in js by obtaining handler on anchor or class.
tags: ctreeview, link, class