laravel - Laravel5.2 custom directive variable type change -


i have problem creating custom laravel blade directive. want create directive @message($message). argument expected associative array (and 100% sure $message contains array). code:

index.blade.php:

<?php $message = array("item" => "value"); ?>  @if(isset($message))     @message($message) @endif 

custom directive declaration:

    blade::directive('message', function($message){          if(is_array($message)){              return "<?php print 'is array'; ?>";          }else{              return "<?php print 'is not array'; ?>";          }     }); 

no matter do, output says, not array. searched everywhere, didnt find answer. can explain?


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -