本文整理汇总了PHP中URL::action方法的典型用法代码示例。如果您正苦于以下问题:PHP URL::action方法的具体用法?PHP URL::action怎么用?PHP URL::action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URL
的用法示例。
在下文中一共展示了URL::action方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: echoMenu
public function echoMenu($items)
{
foreach ($items as $key => $item) {
if (!array_key_exists($item->id, $this->echoed)) {
$this->countLevel($item);
$this->echoed[$item->id] = $this->level;
echo '<tr><td>';
for ($i = 0; $i < $this->echoed[$item->id]; $i++) {
echo "--";
}
echo " " . $item->id . '</td>
<td>' . __(dots($item->title, 90)) . '</td>
<td><a class="btn btn-primary" href="' . _l(URL::action('MenuController@getItemEdit') . '/' . $item->id) . '">' . __(Lang::get('admin.edit')) . '</a></td>
<td><a href="#" data-toggle="modal" data-target="#confirm-delete" class="btn btn-danger" data-href="' . URL::action('MenuController@getItemDestroy') . '/' . $item->id . '">' . __(Lang::get('admin.delete')) . '</a></td>
</tr>';
}
if ($item->children()->count() > 0) {
$this->echoMenu($item->children);
}
}
}
示例2: getUrl
public function getUrl($url = null)
{
if (empty($url)) {
$url = URLHelperFacade::canonicalizeHost(\URL::action('Media\\IndexController@index'));
}
return $url;
}
示例3: getVideo
public function getVideo()
{
$url = \URL::action('loggedController@saveVideo');
$title1 = 'Add';
$title = 'Video';
return view('addVideo')->with('url', $url)->with('title1', $title1)->with('title', $title);
}
示例4: getCurrentActionURL
/**
* Builds the current route controller with given action name and parameters
* @param string $action
* @param array $parameters
* @return string
*/
protected function getCurrentActionURL($action, $parameters = [])
{
// build the controller name with the action
$url = $this->getCurrentActionForName($action);
// return the action url with given parameters
return \URL::action($url, $parameters);
}
示例5: index
public function index()
{
$users = DB::table(DB_USERS)->whereIn('role', array_keys(self::$roles))->orderBy('name')->get();
foreach ($users as &$user) {
$user->role = self::$roles[$user->role];
$user->link = URL::action('UserController@edit', $user->id);
$user->delete = URL::action('UserController@delete', $user->id);
}
return View::make('avalon::users.index', array('users' => $users));
}
示例6: index
public function index($object_name)
{
$object = DB::table(DB_OBJECTS)->where('name', $object_name)->first();
$fields = DB::table(DB_FIELDS)->where('object_id', $object->id)->orderBy('precedence')->get();
foreach ($fields as &$field) {
$field->link = URL::action('FieldController@edit', array($object->name, $field->id));
$field->type = trans('avalon::messages.fields_types_' . $field->type);
}
return View::make('avalon::fields.index', ['object' => $object, 'fields' => $fields]);
}
示例7: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (!$this->userService->isSignedIn()) {
if ($request->ajax()) {
return response('Unauthorized.', 401);
} else {
return redirect()->guest(\URL::action('User\\AuthController@getSignIn'));
}
}
view()->share('authUser', $this->userService->getUser());
return $next($request);
}
示例8: postComment
public function postComment(AddCommentRequest $request)
{
$game = Game::where('instanceId', $request->get('game_id'))->first();
$membershipId = $this->user->account->destiny->membershipId;
$comment = new Comment();
$comment->comment = $request->get('message');
$comment->membershipId = $membershipId;
$comment->characterId = $game->findAccountViaMembershipId($membershipId, false)->characterId;
$comment->parent_comment_id = 0;
$game->comments()->save($comment);
return response()->json(['flag' => true, 'url' => \URL::action('Destiny\\GameController@getGame', $game->instanceId)]);
}
示例9: manage
public function manage($class)
{
$controller = $this->getController($class);
$model = $controller->getModelBuilder()->getName();
$fb = $this->formBuilder;
$fb->action(\URL::action(get_called_class() . '@createController'));
$fb->text('original')->label('Original controller')->value(get_class($controller));
$fb->text('controller')->label('Controller name')->value($model . 'Controller');
$fb->text('path')->label('Path')->value('../app/controllers');
$form = $fb->build();
return View::make('crud::manager/manage', compact('form'));
}
示例10: index
public function index()
{
$objects = DB::table(DB_OBJECTS)->join(DB_USERS, DB_USERS . '.id', '=', DB_OBJECTS . '.updated_by')->select(DB_OBJECTS . '.*', DB_USERS . '.name AS updated_name')->orderBy('list_grouping')->orderBy('title')->get();
foreach ($objects as &$object) {
$object->link = URL::action('InstanceController@index', $object->name);
$object->updated_by = $object->name;
if ($object->count == 0) {
$object->instance_count = '';
}
}
return View::make('avalon::objects.index', ['objects' => $objects]);
}
示例11: buildRSVPResponse
/**
* @param $user
* @param $all
* @return string
*/
public static function buildRSVPResponse($user, $all)
{
$msg = '';
// Lets check if char_id is 0, if so. Let the user know of their chars with numbers to pick one.
if (intval($all['char_id']) == 0) {
$count = 0;
$msg = 'I need to know which character you want to be <strong>' . $user->account->gamertag . '</strong> for this event. Below are your characters with a number next to them. <br /><br />';
foreach ($user->account->destiny->characters as $char) {
$msg .= ++$count . ". - " . $char->name() . " " . $char->highest_light . "/" . $char->light . "<br />";
}
$msg .= '<br />Your new command will be <strong>/bot rsvp ' . $all['game_id'] . ' #</strong> Where # is one of the numbers above.';
} else {
// does this char even exist
$char = $user->account->destiny->characterAtPosition($all['char_id']);
if ($char instanceof Character) {
try {
$event = GameEvent::where('id', intval($all['game_id']))->firstOrFail();
if ($event->isFull()) {
$msg = 'Ouch sorry man. This event is Full. No more RSVPs allowed';
} else {
if ($event->isAttending($user)) {
$msg = 'O think your slick eh? You are already attending this event. There is nothing you need to do.';
} else {
if ($event->isOver()) {
$msg = 'Sorry this event is over. No more RSVPs are allowed.';
} else {
$attendee = new Attendee();
$attendee->game_id = $event->id;
$attendee->membershipId = $user->account->destiny_membershipId;
$attendee->characterId = $char->characterId;
$attendee->account_id = $user->account->id;
$attendee->user_id = $user->id;
$attendee->save();
$msg = 'Congrats <strong> ' . $user->account->gamertag . '</strong> you have sealed a spot in this ';
$msg .= '<a href="' . \URL::action('CalendarController@getEvent', [$event->id]) . '">event</a>. There are <strong>' . ($event->spotsRemaining() - 1) . '</strong> spots remaining.';
}
}
}
} catch (ModelNotFoundException $e) {
$msg = 'Sorry to break the news to you, but this event does not exist. Please try a different gameId.';
}
} else {
$count = 0;
$msg = 'Trying to be funny I see. That character does not exist for you. I guess I have to remind you. <br /><br />';
foreach ($user->account->destiny->characters as $char) {
$msg .= ++$count . ". - " . $char->name() . " " . $char->highest_light . "/" . $char->light . "<br />";
}
$msg .= '<br />Your new command will be <strong>/bot rsvp ' . $all['game_id'] . ' #</strong> Where # is one of the numbers above.';
}
}
return $msg;
}
示例12: index
public function index()
{
if ($tables = array_diff(ObjectController::getTables(), self::getAvalonTables())) {
foreach ($tables as &$table) {
$table = '\'' . $table . '\'';
}
$tables = DB::select('SHOW TABLE STATUS WHERE Name IN (' . implode(',', $tables) . ')');
foreach ($tables as &$table) {
$table->link = URL::action('ImportController@show', $table->Name);
$table->Data_length = self::formatBytes($table->Data_length);
}
}
return View::make('avalon::import.index', compact('tables'));
}
示例13: render
public function render()
{
$icon = '';
if ($this->icon != null) {
$icon = "<i class='fa fa-fw {$this->icon}'></i>";
}
$url = '#';
if ($this->action != null) {
$url = \URL::action($this->action, $this->data);
}
if ($this->url != null) {
$url = $this->url;
}
return "<a target='{$this->target}' class='btn {$this->class}' href='{$url}'>{$icon}{$this->text}</a>";
}
示例14: post_login
public function post_login()
{
$login_data = array('username' => \Input::get('req_username'), 'password' => \Input::get('req_password'));
// TODO: Add remember me setting once supported by Illuminate
if (\Auth::attempt($login_data)) {
// Make sure last_visit data is properly updated
\Session::sweep();
// TODO: This is properly validated in URL::to, right?
$redirect_url = \Input::get('redirect_url', \URL::action('fluxbb::home@index'));
return \Redirect::to($redirect_url)->with('message', 'You were successfully logged in.');
} else {
$errors = new \Illuminate\Validation\MessageBag();
$errors->add('login', 'Invalid username / password combination.');
return \Redirect::action('fluxbb::auth@login')->withInput(\Input::all())->with('errors', $errors);
}
}
示例15: getTagCloud
public static function getTagCloud()
{
$products = self::join('fbf_food_product_recipe', 'fbf_food_products.id', '=', 'fbf_food_product_recipe.product_id')->join('fbf_food_recipes', 'fbf_food_product_recipe.recipe_id', '=', 'fbf_food_recipes.id')->select(\DB::raw('fbf_food_products.*, COUNT(fbf_food_product_recipe.recipe_id) as num_recipes'))->live()->where('fbf_food_recipes.status', '=', Recipe::APPROVED)->where('fbf_food_recipes.published_date', '<=', \Carbon\Carbon::now())->groupBy('fbf_food_products.id')->orderBy('fbf_food_products.name', 'asc')->get();
$results = array();
$maxRecipes = 0;
foreach ($products as $product) {
$maxRecipes = max($maxRecipes, $product->num_recipes);
}
foreach ($products as $product) {
if ($product->num_recipes == 0) {
continue;
}
$results[] = array('name' => $product->name, 'url' => \URL::action('Fbf\\LaravelFood\\RecipesController@indexByProduct', array('productSlug' => $product->slug)), 'weight' => round($product->num_recipes / $maxRecipes, 1) * 10);
}
return $results;
}