any way to passing data from controller to view file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ganesanjc
    Senior Member
    • Apr 2019
    • 116

    any way to passing data from controller to view file

    any way to passing data from controller to view file plz update
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • ganesanjc
      Senior Member
      • Apr 2019
      • 116

      #3
      any way to passing data from PHP file controller to view file

      Comment

      • Andorxor
        Member
        • May 2019
        • 65

        #4
        You could nicely ask the Controller with Ajax to deliver the data,or you could override actionRead and add the extradata there(The data is than avaible in your model).
        PHP Code:
        public function actionRead($params, $data, $request)
         {      
               $r = parent::actionRead($params,$data,$request);
                $r->extraData ="I Like Espo.";
                return $r;
         } 
        
        or
        PHP Code:
        public function getActionExtradData($params,$data,$request)
        {
              $r= new \StdClass();
              $r->extraData = 'I do not dislike Espo':
              return $r;
        } 
        
        which you can call under 'CRM/api/v1/{Your Entity}/action/extraData'.
        Last edited by Andorxor; 10-15-2019, 08:17 AM.

        Comment

        Working...