本文整理汇总了PHP中Route::input方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::input方法的具体用法?PHP Route::input怎么用?PHP Route::input使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Route
的用法示例。
在下文中一共展示了Route::input方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSubDomainParameter
/**
* Get the subdomain parameter value
*
* @return string|null subdomain parameter value
*/
private function getSubDomainParameter()
{
if (\Route::current()) {
return \Route::input(config('tenant.subdomain'));
}
return null;
}
示例2: indexAction
/**
* Returns the initial HTML view for the admin interface.
*
* @return Response Response object containing the generated output
*/
public function indexAction()
{
$site = \Route::input('site', 'default');
$lang = \Route::input('locale', 'en');
$aimeos = app('\\Aimeos\\Shop\\Base\\Aimeos')->get();
$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
$context = app('\\Aimeos\\Shop\\Base\\Context')->get(false);
$context = $this->setLocale($context, $site, $lang);
$controller = new \Controller_ExtJS_JsonRpc($context, $cntlPaths);
$cssFiles = $jsFiles = array();
foreach ($aimeos->getCustomPaths('client/extjs') as $base => $paths) {
foreach ($paths as $path) {
$jsbAbsPath = $base . '/' . $path;
if (!is_file($jsbAbsPath)) {
throw new Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
}
$jsb2 = new \MW_Jsb2_Default($jsbAbsPath, dirname($path));
$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
$jsFiles = array_merge($jsFiles, $jsb2->getUrls('js'));
}
}
$params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}');
$adminUrl = route('aimeos_shop_admin', $params);
$jsonUrl = route('aimeos_shop_admin_json', array('_token' => csrf_token()));
$vars = array('lang' => $lang, 'jsFiles' => $jsFiles, 'cssFiles' => $cssFiles, 'languages' => $this->getJsonLanguages($context), 'config' => $this->getJsonClientConfig($context), 'site' => $this->getJsonSiteItem($context, \Input::get('site', 'default')), 'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang), 'searchSchemas' => $controller->getJsonSearchSchemas(), 'itemSchemas' => $controller->getJsonItemSchemas(), 'smd' => $controller->getJsonSmd($jsonUrl), 'urlTemplate' => urldecode($adminUrl), 'uploaddir' => \Config::get('shop::uploaddir'), 'activeTab' => \Input::get('tab', 0), 'version' => $this->getVersion());
return \View::make('shop::admin.index', $vars);
}
示例3: image
public function image()
{
$key = strip_tags(\Route::input('key'));
$key = str_replace('.png', '', $key);
if (empty($key)) {
return redirect('/');
} else {
$result = \DB::table('post')->where('post_key', $key)->first();
if ($result->post_type == 3) {
$text = $result->post_message;
$text = $this->handleText($text);
$image = $this->warpTextImage($text);
ob_start();
imagepng($image, null, 9, null);
$image = ob_get_contents();
ob_end_clean();
@imagedestroy($image);
$response = \Response::make($image);
$response->header('Content-Type', 'image/png');
return $response;
} else {
return redirect('/');
}
}
}
示例4: handleRequest
protected function handleRequest(Request $request)
{
$fid = \Route::input('id');
$this->forum = Forum::with('perms')->findOrFail($fid);
$this->subject = $request->input('req_subject');
$this->message = $request->input('req_message');
}
示例5: handleRequest
protected function handleRequest(Request $request)
{
$fid = \Route::input('id');
$forum = Forum::with('perms')->findOrFail($fid);
$this->data['forum'] = $forum;
$this->data['action'] = trans('fluxbb::forum.post_topic');
}
示例6: getSubDomainParameter
/**
* Get the subdomain parameter value
*
* @return string|null subdomain parameter value
*/
private function getSubDomainParameter()
{
if (\Route::current() && ($param = \Route::input(config('tenant.subdomain')))) {
return $param;
}
return $this->extractSubdomainFromUrl();
}
示例7: handleRequest
protected function handleRequest(Request $request)
{
$pid = \Route::input('id');
// Fetch some info about the topic
$topic = Post::with('author', 'topic')->findOrFail($pid);
$this->data['post'] = $post;
$this->data['action'] = trans('fluxbb::forum.edit_post');
}
示例8: handleRequest
protected function handleRequest(Request $request)
{
$tid = \Route::input('id');
// Fetch some info about the topic
$topic = Topic::with('forum.perms')->findOrFail($tid);
$this->data['topic'] = $topic;
$this->data['action'] = trans('fluxbb::post.post_a_reply');
}
示例9: handleRequest
protected function handleRequest(Request $request)
{
$tid = \Route::input('id');
// Fetch some info about the topic
$topic = Topic::findOrFail($tid);
// Make sure post authors and their groups are all loaded
$topic->posts->load('author.group');
$this->data['topic'] = $topic;
}
示例10: handleRequest
protected function handleRequest(Request $request)
{
$pid = \Route::input('id');
// If a post ID is specified we determine topic ID and page number so we can show the correct message
$this->post = Post::findOrFail($pid);
// Determine on which page the post is located
$numPosts = Post::where('topic_id', '=', $this->post->topic_id)->where('posted', '<', $this->post->posted)->count('id') + 1;
$dispPosts = User::current()->dispPosts();
$this->page = ceil($numPosts / $dispPosts);
}
示例11: authorize
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
$taskId = \Route::input('task');
// verify user logged in
if (!Auth::user()) {
return false;
}
// // verify if task is user's
// $task = Task::own()->first();
// if ($task) {
// return true;
// }
return true;
}
示例12: getFixedParams
/**
* Returns the routing parameters passed in the URL
*
* @return array Associative list of parameters with "site", "locale" and "currency" if available
*/
protected function getFixedParams()
{
$fixed = array();
if (($value = \Route::input('site')) !== null) {
$fixed['site'] = $value;
}
if (($value = \Route::input('locale')) !== null) {
$fixed['locale'] = $value;
}
if (($value = \Route::input('currency')) !== null) {
$fixed['currency'] = $value;
}
return $fixed;
}
示例13: __construct
public function __construct(PhoneInterface $phones, PhoneForm $phoneForm, FaxInterface $faxes, Users $users, GroupInterface $groups)
{
parent::__construct();
$this->users = $users;
$this->phones = $phones;
$this->faxes = $faxes;
$this->phoneForm = $phoneForm;
$this->groups = $groups;
$id = Route::input('phones');
$resource = 'Faxbox\\Repositories\\Phone\\PhoneInterface';
$admin = Permissions::name($resource, 'admin', $id);
$this->beforeFilter('auth');
$this->beforeFilter('accessResource:' . $admin, ['only' => ['delete']]);
$this->beforeFilter('accessResource:purchase_numbers', ['except' => ['delete']]);
}
示例14: existsFilter
/**
* URLパラメータのidの存在をチェックする。
*
* @return void
*/
public function existsFilter()
{
info(__METHOD__ . ' called.');
// URLにパラメータ'id'が存在したら
$id = Route::input('id');
if ($id) {
logger("todo id({$id}) checking...");
// 指定のIDがtodosテーブルに存在しなかったら
if (!Todo::withTrashed()->exists($id)) {
logger('Nothing!');
// Webブラウザに404 Not Foundを返す
App::abort(404);
}
logger('Exists!');
} else {
logger('url was not contained $id.');
}
}
示例15: get_question
/**
* Displays the view
*
*/
public static function get_question()
{
/* if('name' === Route::currentRouteName()){
$id = 0;
$form = 'forms/form2';
}*/
if (Route::input('id')) {
$id = Route::input('id');
} elseif ('home' === Route::currentRouteName()) {
$id = 1;
} else {
Log::error('Unable to get question. No question id was located.');
return Redirect::to('error');
}
$form = 'forms/form1';
$question = self::$questions[$id];
$restart = route('home');
return View::make('survey', array('question' => $question, 'restart' => $restart))->nest('form', $form, array('url' => "question/{$id}"));
}