Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

how to pass params #4

Open
tangzicheng opened this issue Mar 21, 2020 · 0 comments
Open

how to pass params #4

tangzicheng opened this issue Mar 21, 2020 · 0 comments

Comments

@tangzicheng
Copy link

tangzicheng commented Mar 21, 2020

  1 @php
  2 $array = array_fill(0, 10, 'hello');
  3 \Log::info($array);
  4 @endphp
  5 @wct ({{ $array }})
  6 
17     public function getDirectives()
 18     {
 19       \Log::info(__FUNCTION__);
 20       return [
 21         'wct' => [$this, 'getWechatContentTemplate']
 22       ];
 23     }
 24 

 33     public function getConditionals()
 34     {
 35         return [];
 36     }
 37 
 38     public function getWechatContentTemplate($values) {
 39       \Log::info($values);
 40       if(isset($values) && is_array($values) && array_key_exists('code', $values)) {
 41         $wct = Esl\WechatContentTemplate::where('code', $values['code'])->first();
 42         if(isset($wct)) {
 43           return $wct->content;
 44         } else {
 45           return '';
 46         }
 47       } else {
 48         return '';
 49       }
 50     }

the log is

[2020-03-21 17:28:36] local.INFO: {{ $array }}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant