Jump to:

3373 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » How to get the response of data

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 559 Views
  • ajay
    Avatar
    Community Member
    1 Post

    How to get the response of data Link to this post

    hy i have created Property.php,Media.php file in the mysite/code folder now i wants to access the of Property class than how should ido?

    i am trying it by http://localhost/ss/Property/ReadFile . but it redirects me to 404 error found page. what should i do?

    here is the sample code

    <?php
       Class Property extends Page{      
          static $db = array(
             'AGENT_REF'=>"Varchar(20)",
             'ADDRESS_1'=>"Varchar(60)",
             'ADDRESS_2'=>"Varchar(60)",
             'ADDRESS_3'=>"Varchar(60)",
             'ADDRESS_4'=>"Varchar(60)",
             'PINCODE1'=>'Varchar(10)',
             'PINCODE2'=>'Varchar(10)',
             'FEATURE1'=>'Varchar(60)',
             
             'PROP_SUB_ID'=>"Int", //comes from property subject table
             
             
          );

          
       }
       /*------------Controller------------------------*/
       class Property_Controller extends Page_Controller {
          //public $blm_file_content="";
          function ReadFile($filename){
             $media_image_path="path to upload folder";
             $filepath="file path";
             if(file_exists($filepath)){
                $tmpDir = dir($filepath);
                $tmpDir->handle ;            
                while (false !== ($name = $tmpDir->read())) {
                   $path_parts = pathinfo($filepath.$name);               
                   if(strtolower($path_parts['extension'])=="blm"){
                      echo "Here ";
                   }
                }
                $tmpDir->close();
             }      
          }
          
       }
    ?>

    please help me.
    sorry for my bad english

    559 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.