@each(): directive is only an alias of the
@foreach(): conditional loop operator directive.
<?php
namespace spoova\mi\windows\Routes;
use Route;
class Home extends Route {
function __construct() {
self::call($this, [
// declare accepted urls
lastUrl() => 'home';
// parse variable arguments
SELF::ARGS => [
'list' => [1, 2, 3]
]
]);
}
function home($args) {
self::load('home' => compile($args));
}
}
@for(): condition. This is shown below
@each($list as $key => $value):
List {{ $key }} => {{ $value }} <br>
@endeach;
List 0 => 1
List 1 => 2
List 2 => 3