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

how to pass params #4

@tangzicheng

Description

@tangzicheng
  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 }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions