本文整理汇总了PHP中Input::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Input::get方法的具体用法?PHP Input::get怎么用?PHP Input::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Input
的用法示例。
在下文中一共展示了Input::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createParent
public function createParent()
{
$input = Input::all();
if (Input::hasFile('profilepic')) {
$input['profilepic'] = $this->filestore(Input::file('profilepic'));
}
$input['dob'] = date('Y-m-d H:i:s', strtotime(Input::get('dob')));
$input['collegeid'] = Session::get('user')->collegeid;
$input['collegename'] = Admin::where('collegeid', '=', Session::get('user')->collegeid)->first()->collegename;
//$input['collegeid']="dummy";
//$input['collegename']="dummy";
$user = new User();
$user->email = $input['email'];
$user->password = Hash::make($input['password']);
$user->collegeid = $input['collegeid'];
$user->flag = 3;
$user->save();
$input['loginid'] = $user->id;
$removed = array('_token', 'password', 'cpassword');
foreach ($removed as $k) {
unset($input[$k]);
}
Parent::saveFormData($input);
return $input;
}
示例2: determineMode
/**
* Determine the current rendering mode.
*
* @return string
*/
public function determineMode()
{
if (TL_MODE == 'FE') {
$user = $this->resolveBackendUser();
if ($user) {
if ($this->input->get('theme_plus_compile_assets')) {
return RenderMode::PRE_COMPILE;
} elseif ($user->themePlusDesignerMode) {
return RenderMode::DESIGN;
}
}
return RenderMode::LIVE;
}
throw new \RuntimeException('Render mode can only determined in FE mode');
}
示例3: getRelatorioOperacoes
public static function getRelatorioOperacoes()
{
Excel::create('Planilha de Controle da Farmacia - Ocorrencias', function ($excel) {
$excel->sheet('Ref. ', function ($sheet) {
$sheet->mergeCells('A1:J5');
$sheet->setHeight(1, 50);
$sheet->row(1, function ($row) {
$row->setFontFamily('Arial');
$row->setFontSize(20);
});
$sheet->cell('A1', function ($cell) {
$cell->setAlignment('center');
});
$sheet->getStyle('D')->getAlignment()->setWrapText(true);
$sheet->row(1, array('Frizelo Frigorificos Ltda.'));
$periodo = explode('-', Input::get('periodo'));
$a = [];
foreach (Ocorrencia::whereBetween('data_hora', $periodo)->get() as $val) {
$a[] = ['Nome' => $val->colaborador->nome, 'Setor' => !empty($val->colaborador->setor->descricao) ? $val->colaborador->setor->descricao : null, 'Data' => $val->data_hora, 'Queixa' => empty($val->queixa->descricao) ? null : $val->queixa->descricao, 'Descrição / Motivo' => $val->relato . ' - ' . $val->diagnostico, 'Conduta / Destino' => $val->conduta . ' - ' . $val->destino];
}
$sheet->setAutoFilter('A6:J6');
$sheet->setOrientation('landscape');
$sheet->fromArray($a, null, 'A6', true);
});
})->export('xls');
}
示例4: __construct
/**
* เรียกใช้งาน Class แบบสามารถเรียกได้ครั้งเดียวเท่านั้น
*
* @param array $config ค่ากำหนดของ แอพพลิเคชั่น
* @return Singleton
*/
public function __construct()
{
/* display error */
if (defined('DEBUG') && DEBUG === true) {
/* ขณะออกแบบ แสดง error และ warning ของ PHP */
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
} else {
/* ขณะใช้งานจริง */
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
}
/* config */
self::$cfg = \Config::create();
/* charset default UTF-8 */
ini_set('default_charset', self::$char_set);
if (extension_loaded('mbstring')) {
mb_internal_encoding(self::$char_set);
}
/* inint Input */
Input::normalizeRequest();
// template ที่กำลังใช้งานอยู่
Template::inint(Input::get($_GET, 'skin', self::$cfg->skin));
/* time zone default Thailand */
@date_default_timezone_set(self::$cfg->timezone);
}
示例5: postIndex
public function postIndex()
{
if (\Auth::attempt(array('email' => \Input::get('email'), 'password' => \Input::get('password')))) {
return \Redirect::intended('/');
}
return \Redirect::to('/?errors=true');
}
示例6: compile
/**
* Generate the content element
*/
public function compile()
{
global $container;
/** @var SubscriptionManager $subscriptionManager */
$subscriptionManager = $container['avisota.subscription'];
/** @var EventDispatcher $eventDispatcher */
$eventDispatcher = $container['event-dispatcher'];
$token = (array) \Input::get('token');
if (count($token)) {
$subscriptions = $subscriptionManager->confirmByToken($token);
\Session::getInstance()->set('AVISOTA_LAST_SUBSCRIPTIONS', $subscriptions);
if ($this->avisota_activation_confirmation_page) {
$event = new GetPageDetailsEvent($this->avisota_activation_confirmation_page);
$eventDispatcher->dispatch(ContaoEvents::CONTROLLER_GET_PAGE_DETAILS, $event);
$event = new GenerateFrontendUrlEvent($event->getPageDetails());
$eventDispatcher->dispatch(ContaoEvents::CONTROLLER_GENERATE_FRONTEND_URL, $event);
$event = new RedirectEvent($event->getUrl());
$eventDispatcher->dispatch(ContaoEvents::CONTROLLER_REDIRECT, $event);
}
$this->Template->confirmed = $subscriptions;
} else {
if ($this->avisota_activation_redirect_page) {
$event = new GetPageDetailsEvent($this->avisota_activation_redirect_page);
$eventDispatcher->dispatch(ContaoEvents::CONTROLLER_GET_PAGE_DETAILS, $event);
$event = new GenerateFrontendUrlEvent($event->getPageDetails());
$eventDispatcher->dispatch(ContaoEvents::CONTROLLER_GENERATE_FRONTEND_URL, $event);
$event = new RedirectEvent($event->getUrl());
$eventDispatcher->dispatch(ContaoEvents::CONTROLLER_REDIRECT, $event);
}
}
}
示例7: postDelete
public function postDelete()
{
$id = Input::get('id');
$delpro = Program::find($id);
$delpro->delete();
return 1;
}
示例8: store
/**
* Upload the file and store
* the file path in the DB.
*/
public function store()
{
// Rules
$rules = array('name' => 'required', 'file' => 'required|max:20000');
$messages = array('max' => 'Please make sure the file size is not larger then 20MB');
// Create validation
$validator = Validator::make(Input::all(), $rules, $messages);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
$directory = "uploads/files/";
// Before anything let's make sure a file was uploaded
if (Input::hasFile('file') && Request::file('file')->isValid()) {
$current_file = Input::file('file');
$filename = Auth::id() . '_' . $current_file->getClientOriginalName();
$current_file->move($directory, $filename);
$file = new Upload();
$file->user_id = Auth::id();
$file->project_id = Input::get('project_id');
$file->name = Input::get('name');
$file->path = $directory . $filename;
$file->save();
return Redirect::back();
}
$upload = new Upload();
$upload->user_id = Auth::id();
$upload->project_id = Input::get('project_id');
$upload->name = Input::get('name');
$upload->path = $directory . $filename;
$upload->save();
return Redirect::back();
}
示例9: generate
/**
* Redirect to an internal page
* @param object
*/
public function generate($objPage)
{
// Forward to the jumpTo or first published page
if ($objPage->jumpTo) {
$objNextPage = \PageModel::findPublishedById($objPage->jumpTo);
} else {
$objNextPage = \PageModel::findFirstPublishedRegularByPid($objPage->id);
}
// Forward page does not exist
if ($objNextPage === null) {
header('HTTP/1.1 404 Not Found');
$this->log('Forward page ID "' . $objPage->jumpTo . '" does not exist', 'PageForward generate()', TL_ERROR);
die('Forward page not found');
}
$strGet = '';
// Add $_GET parameters
if (is_array($_GET) && !empty($_GET)) {
foreach (array_keys($_GET) as $key) {
if ($GLOBALS['TL_CONFIG']['disableAlias'] && $key == 'id') {
continue;
}
if ($GLOBALS['TL_CONFIG']['addLanguageToUrl'] && $key == 'language') {
continue;
}
$strGet .= '/' . $key . '/' . \Input::get($key);
}
}
$this->redirect($this->generateFrontendUrl($objNextPage->row(), $strGet), $objPage->redirect == 'temporary' ? 302 : 301);
}
示例10: store
function store()
{
$rules = array('icao' => 'alpha_num|required', 'iata' => 'alpha_num', 'name' => 'required', 'city' => 'required', 'lat' => 'required|numeric', 'lon' => 'required|numeric', 'elevation' => 'required|numeric', 'country_id' => 'required|exists:countries,id', 'website' => 'url');
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
Messages::error($validator->messages()->all());
return Redirect::back()->withInput();
}
if (is_null($airport = Airport::whereIcao(Input::get('icao'))->whereNew(true)->first())) {
$airport = new Airport();
$airport->icao = Input::get('icao');
$airport->name = Input::get('name');
$airport->new = true;
$airport->save();
}
Diff::compare($airport, Input::all(), function ($key, $value, $model) {
$change = new AirportChange();
$change->airport_id = $model->id;
$change->user_id = Auth::id();
$change->key = $key;
$change->value = $value;
$change->save();
}, ['name', 'iata', 'city', 'country_id', 'lat', 'lon', 'elevation', 'website']);
Messages::success('Thank you for your submission. We will check whether all information is correct and soon this airport might be available.');
return Redirect::back();
}
示例11: showCaret
function showCaret($field)
{
if (Input::get('orderby') == $field) {
return 'asc';
}
return 'desc';
}
示例12: all
/**
* Mendapatkan Semua Stockproducthistory
* @return mixed
*/
public function all()
{
$page = \Input::get('page');
$limit = \Input::get('limit', 1);
$start = \Input::get('start', 1);
if (Input::has('stock_id')) {
$stockId = Input::get('stock_id');
return $this->getHistoryStockById($stockId, $limit, $start, $page);
}
/*Mesti ada Stock Id*/
return Response::json(['success' => true, 'error' => true, 'reason' => 'No Parameter Stock Id'], 200);
// ->setCallback(\Input::get('callback'));
// $stockproducthistory = $this->stockproducthistory
// ->orderBy('id', 'DESC')
// ->skip($start)
// ->take($limit)
// ->get()->toArray();
// $total = $this->stockproducthistory
// ->all()->count();
//
// $stockproducthistorys = array(
// 'success' => true,
// 'results' => $stockproducthistory,
// 'total' => $total
// );
//
// return Response::json($stockproducthistorys)
// ->setCallback(\Input::get('callback'));
}
示例13: user
public static function user()
{
if (self::$user !== false) {
return self::$user;
}
FacebookSession::setDefaultApplication(\Config::get('fb-auth::config.facebook_app_id'), \Config::get('fb-auth::config.facebook_secret'));
$token = \Input::get('accessToken');
if (!$token) {
$token = \Request::header('FB-Access-Token');
}
if (!$token) {
self::$user = null;
return null;
}
$session = new FacebookSession($token);
try {
$me = (new FacebookRequest($session, 'GET', '/me'))->execute()->getGraphObject(GraphUser::className());
self::$user = \User::from_fb($me);
} catch (FacebookAuthorizationException $e) {
self::$user = null;
} catch (FacebookRequestException $e) {
self::$user = null;
} catch (\Exception $e) {
self::$user = null;
}
return self::$user;
}
示例14: compile
/**
* Compile the view
*/
protected function compile()
{
if (!$this->getConfigAttribute('plain')) {
if ($this->getConfigAttribute('table') === true) {
$this->setConfigAttribute('table', $this->definition->getName());
}
if ($this->getConfigAttribute('id') === true) {
$this->setConfigAttribute('id', \Input::get('id'));
}
$strHref = \Environment::get('script') . '?do=' . \Input::get('do');
if ($this->view->getHref() != '') {
$strHref .= '&' . $this->view->getHref();
}
$this->setConfigAttribute('rt', \RequestToken::get());
$attributes = array();
if ($this->getConfigAttribute('id')) {
$attributes[] = 'id';
}
if ($this->getConfigAttribute('table')) {
$attributes[] = 'table';
}
$attributes[] = 'rt';
$strHref .= '&' . $this->buildHref($attributes);
$this->view->setHref($strHref);
}
}
示例15: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$lskill = new Lskill();
// skill Model 内容
$lskill->name_jp = Input::get('name_jp');
$lskill->name_en = Input::get('name_en');
$lskill->name_cn = Input::get('name_cn');
$lskill->desc_jp = Input::get('desc_jp');
$lskill->desc_en = Input::get('desc_en');
$lskill->desc_cn = Input::get('desc_cn');
$lskill->race = Input::get('race');
$lskill->attr = Input::get('attr');
$lskill->job = Input::get('job');
$lskill->power = Input::get('power');
$lskill->power_type = Input::get('power_type');
$lskill->admin_memo = Input::get('admin_memo');
// 原则上做成时非公开
$lskill->open = false;
// $lskill->update_datetime = now();
if ($lskill->save()) {
return Redirect::to('skill');
} else {
return Redirect::back()->withInput()->withErrors('保存失败!');
}
}