Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 150
Zeile 89... Zeile 89...
89
            return $this->factory->getFragment($fragment);
89
            return $this->factory->getFragment($fragment);
90
        });
90
        });
91
    }
91
    }
Zeile 92... Zeile 92...
92
 
92
 
-
 
93
    /**
-
 
94
     * Get the evaluated contents for a given array of fragments.
-
 
95
     *
-
 
96
     * @param  array  $fragments
-
 
97
     * @return string
-
 
98
     */
-
 
99
    public function fragments(array $fragments)
-
 
100
    {
-
 
101
        return collect($fragments)->map(fn ($f) => $this->fragment($f))->implode('');
-
 
102
    }
-
 
103
 
-
 
104
    /**
-
 
105
     * Get the evaluated contents of a given fragment if the given condition is true.
-
 
106
     *
-
 
107
     * @param  bool  $boolean
-
 
108
     * @param  string  $fragment
-
 
109
     * @return string
-
 
110
     */
-
 
111
    public function fragmentIf($boolean, $fragment)
-
 
112
    {
-
 
113
        if (value($boolean)) {
-
 
114
            return $this->fragment($fragment);
-
 
115
        }
-
 
116
 
-
 
117
        return $this->render();
-
 
118
    }
-
 
119
 
-
 
120
    /**
-
 
121
     * Get the evaluated contents for a given array of fragments if the given condition is true.
-
 
122
     *
-
 
123
     * @param  bool  $boolean
-
 
124
     * @param  array  $fragments
-
 
125
     * @return string
-
 
126
     */
-
 
127
    public function fragmentsIf($boolean, array $fragments)
-
 
128
    {
-
 
129
        if (value($boolean)) {
-
 
130
            return $this->fragments($fragments);
-
 
131
        }
-
 
132
 
-
 
133
        return $this->render();
-
 
134
    }
-
 
135
 
93
    /**
136
    /**
94
     * Get the string contents of the view.
137
     * Get the string contents of the view.
95
     *
138
     *
96
     * @param  callable|null  $callback
139
     * @param  callable|null  $callback
97
     * @return string
140
     * @return string