CakePHP | How to skip CakePHP authentication for some controller methods

| By Webner

Description: By default, CakePHP authentication is applied to all application controllers. So it does not allow users to perform any of the action without login. Solution: Each controller has a beforeFilter method which runs when some action is called from controller.

Java | Delete empty string from list or array

| By Webner

public class deleteEmptyStringQuick { public static void main(String[] args) { String[] emptyStringArray={“test”,”test1″,””,”test3″,””,”test4″}; ArrayList arrayListOfEmptyString=(ArrayList) Arrays.asList(emptyStringArray); //normally we will do this ArrayList filteredList = new ArrayList(); for(String string: arrayListOfEmptyString) { if(!string.isEmpty()) { filteredList.add(string); } } //You can achieve this with single

PHP | Header function not working

| By Webner

Code : Function getredirect($subcontactid) { echo”contactid”.$subcontactid; header(“location:https://subscriptions.zoho.com/app#/customers/$subcontactid”); exit; } The header function in the above code does not work. But when we remove the echo from the code, it works properly. Code after removing echo : Function getredirect($subcontactid) { header(“location:https://subscriptions.zoho.com/app#/customers/$subcontactid”);

Salesforce | Change value of an object’s field on button click and reload page

| By Webner

We can change the value of an object’s field on button click by using javascript like this (and this will also reload the page): { !REQUIRESCRIPT(“/soap/ajax/29.0/connection.js”) } var rec = new sforce.SObject(“Contact”); rec.Id = “{!Contact.Id}”; rec.IsActive= ‘true’; var result =

Generate getter/setter for PHP Classes in Eclipse

| By Webner

Using PHPGen Eclipse plug-in one can automatically generate getter /setter methods for instance variables. Note: This Plugins is not available in Eclipse Marketplace. Steps For Installation: Start Eclipse and add “Help> Install New Software” from following URL: http://loge5.de/downloads/Eclipse/: Click Add,