File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -167,19 +167,23 @@ public function __destruct()
167167 * Add an asset to the pass. Use this function to add images to the pass.
168168 *
169169 * @param string $assetPath
170+ * @param string $name
170171 *
171172 * @throws \InvalidArgumentException
172173 *
173174 * @return void
174175 */
175- public function addAsset ($ assetPath )
176+ public function addAsset ($ assetPath, $ name = null )
176177 {
177178 if (is_file ($ assetPath )) {
178- $ this ->assets [basename ($ assetPath )] = $ assetPath ;
179-
179+ if (empty ($ name )) {
180+ $ this ->assets [basename ($ assetPath )] = $ assetPath ;
181+ } else {
182+ $ this ->assets [$ name ] = $ assetPath ;
183+ }
180184 return ;
181185 }
182-
186+
183187 throw new InvalidArgumentException ("The file $ assetPath does NOT exist " );
184188 }
185189
You can’t perform that action at this time.
0 commit comments