@@ -893,7 +893,7 @@ public function resource(string $name, array $options = null): RouteCollectionIn
893893 *
894894 * Example:
895895 *
896- * $route->resource ('photos');
896+ * $route->presenter ('photos');
897897 *
898898 * // Generates the following routes:
899899 * HTTP Verb | Path | Action | Used for...
@@ -917,13 +917,13 @@ public function presenter(string $name, array $options = null): RouteCollectionI
917917 // In order to allow customization of the route the
918918 // resources are sent to, we need to have a new name
919919 // to store the values in.
920- $ new_name = ucfirst ($ name );
920+ $ newName = ucfirst ($ name );
921921
922922 // If a new controller is specified, then we replace the
923923 // $name value with the name of the new controller.
924924 if (isset ($ options ['controller ' ]))
925925 {
926- $ new_name = ucfirst (filter_var ($ options ['controller ' ], FILTER_SANITIZE_STRING ));
926+ $ newName = ucfirst (filter_var ($ options ['controller ' ], FILTER_SANITIZE_STRING ));
927927 }
928928
929929 // In order to allow customization of allowed id values
@@ -955,35 +955,35 @@ public function presenter(string $name, array $options = null): RouteCollectionI
955955
956956 if (in_array ('index ' , $ methods ))
957957 {
958- $ this ->get ($ name , $ new_name . '::index ' , $ options );
958+ $ this ->get ($ name , $ newName . '::index ' , $ options );
959959 }
960960 if (in_array ('show ' , $ methods ))
961961 {
962- $ this ->get ($ name . '/ ' . $ id , $ new_name . '::show/$1 ' , $ options );
962+ $ this ->get ($ name . '/ ' . $ id , $ newName . '::show/$1 ' , $ options );
963963 }
964964 if (in_array ('new ' , $ methods ))
965965 {
966- $ this ->get ($ name . '/new ' , $ new_name . '::new ' , $ options );
966+ $ this ->get ($ name . '/new ' , $ newName . '::new ' , $ options );
967967 }
968968 if (in_array ('create ' , $ methods ))
969969 {
970- $ this ->post ($ name , $ new_name . '::create ' , $ options );
970+ $ this ->post ($ name , $ newName . '::create ' , $ options );
971971 }
972972 if (in_array ('edit ' , $ methods ))
973973 {
974- $ this ->get ($ name . '/ ' . $ id . '/edit ' , $ new_name . '::edit/$1 ' , $ options );
974+ $ this ->get ($ name . '/ ' . $ id . '/edit ' , $ newName . '::edit/$1 ' , $ options );
975975 }
976976 if (in_array ('update ' , $ methods ))
977977 {
978- $ this ->post ($ name . '/ ' . $ id , $ new_name . '::update/$1 ' , $ options );
978+ $ this ->post ($ name . '/ ' . $ id , $ newName . '::update/$1 ' , $ options );
979979 }
980980 if (in_array ('remove ' , $ methods ))
981981 {
982- $ this ->get ($ name . '/ ' . $ id , $ new_name . '::remove/$1 ' , $ options );
982+ $ this ->get ($ name . '/ ' . $ id , $ newName . '::remove/$1 ' , $ options );
983983 }
984984 if (in_array ('delete ' , $ methods ))
985985 {
986- $ this ->post ($ name . '/ ' . $ id , $ new_name . '::delete/$1 ' , $ options );
986+ $ this ->post ($ name . '/ ' . $ id , $ newName . '::delete/$1 ' , $ options );
987987 }
988988
989989 return $ this ;
0 commit comments