Techbirds | Knowledge Hub | Page 19

  Asynchronous ImageLoading in Listview: There are some libraries available for async Image Loading. Some Of them are: 1.Universal Image Loading 2.AndroidQuery(AQuery)   Here I will explain Async image Loading with “Universal Image Loader”.Following are the steps: Step1: Download universal-image-loader-1.9.2.jar  file add add this in libs folder of your project.   Step2: Create the instance

Read More →

1,557 total views, no views today

Hi folks, In this tutorial , we will learn about how to integrate a normal login flow to facebook from app using a SDK widget. this is found under com.facebook.widget under facebook sdk.jar which is exported in you project from Import / Export of eclipse from the SDK facebook library. make sure this jar is

Read More →

821 total views, no views today

Step 1 Create a new 1024 x 768 px document. Place the Texture 235 image on top of the Background layer, then resize it so that it fits within the document. Place the Northern Lights texture image on top of all layers then change its layer’s Blend Mode to Multiply. Step 2 Create the text

Read More →

1,026 total views, no views today

Problem: empty attribute should NOT be empty, but rather display “No” or “N/A”, depending on its type. Solution: Open the file /app/design/frontend/default/[theme name]/template/catalog/product/view/attribute.phtml

        

        

    

    

replace these lines with :

        

        

    

    

    

    

760 total views, no views today

760 total views, no views today

Posted on: May 25, 2014 /

Categories: PHP / Author Name: Anand Kumar

Problem : model which doesn’t actually have a table. for example validating a form on site e.g contact form Solution :

class ContactForm extends AppModel { var $name = ‘contactForm’; var $useTable = false; var $_schema = array( ‘name’ => array(‘type’=>’string’, ‘length’=>100), ’email’ => array(‘type’=>’string’, ‘length’=>255), ‘details’ => array(‘type’=>’text’) ); var $validate = array( ‘name’ => array( ‘rule’=>array(‘minLength’, 1), ‘message’=>’Name is required’ ), ’email’ => array( ‘rule’=>’email’, ‘message’=>’Must be a valid email address’ ), ‘details’ => array( ‘rule’=>array(‘minLength’, 1), ‘message’=>’Feedback is required’ ) ); }

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

class ContactForm extends AppModel {

    var $name = ‘contactForm’;

    var $useTable = false;

    var $_schema = array(

        ‘name’        =>    array(‘type’=>’string’, ‘length’=>100),

        ’email’        =>    array(‘type’=>’string’, ‘length’=>255),

        ‘details’    =>    array(‘type’=>’text’)

    );

    var $validate = array(

        ‘name’ => array(

            ‘rule’=>array(‘minLength’, 1),

            ‘message’=>’Name is required’ ),

        ’email’ => array(

            ‘rule’=>’email’,

            ‘message’=>’Must be a valid email address’ ),

        ‘details’ => array(

            ‘rule’=>array(‘minLength’, 1),

            ‘message’=>’Feedback is required’ )

    );

}

Note: just use var $useTable = false; 516 total views, no views today

516 total views, no views today