当前位置: 首页>>代码示例>>PHP>>正文


PHP input::has方法代码示例

本文整理汇总了PHP中input::has方法的典型用法代码示例。如果您正苦于以下问题:PHP input::has方法的具体用法?PHP input::has怎么用?PHP input::has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在input的用法示例。


在下文中一共展示了input::has方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMessageOfTheme

 public function getMessageOfTheme()
 {
     if (input::has('themeId')) {
         $themeId = input::get('themeId');
         return MessageThemes::find($themeId)->message;
     } else {
         return "";
     }
 }
开发者ID:PopovDmitry,项目名称:fintech-fab.ru,代码行数:9,代码来源:NoticesController.php

示例2: pageController

function pageController()
{
    $counter = file_get_contents('counter.txt');
    $counter = (int) $counter;
    $newCounter;
    $data = [];
    if (input::has('Hit')) {
        $newCounter = $counter + 1;
        $handle = fopen('counter.txt', 'w');
        fwrite($handle, $newCounter);
        fclose($handle);
    } else {
        if (input::has('Miss')) {
        }
    }
    $_GET;
    $data['counter'] = $newCounter;
    return $data;
}
开发者ID:Penthious,项目名称:Codeup.dev,代码行数:19,代码来源:ping.php

示例3: header

require_once '../../Input.php';
require_once '../../Auth.php';
require_once 'Log.php';
$correctName = Input::get('username', '');
$correctPassword = Input::get('password', '');
if (Auth::check()) {
    header('Location: /php/authorize.php');
    die;
} else {
    if (Auth::attempt($correctName, $correctPassword)) {
        $logFile = new Log();
        $logFile->logMessage('loggedIN', 'user has logged in successfully');
        header('Location: /php/authorize.php');
        die;
    } else {
        if (input::has('username') && input::has('password')) {
            $logFile = new Log();
            $logFile->logMessage('Failed', 'user failed to input correct username or password');
            echo "Please enter the correct username or password.";
        }
    }
}
?>
 <!DOCTYPE html>
 <html>
     <head>
         <link rel="stylesheet" href="/css/">
         <meta charset="utf-8">
         <title></title>
     </head>
     <body>
开发者ID:Penthious,项目名称:Codeup.dev,代码行数:31,代码来源:login.php

示例4: edit

 function edit($id)
 {
     if ($this->data['users']->role != "admin") {
         exit;
     }
     if (User::where('username', trim(Input::get('username')))->where('id', '<>', $id)->count() > 0) {
         return $this->panelInit->apiOutput(false, $this->panelInit->language['editStudent'], $this->panelInit->language['usernameUsed']);
     }
     if (User::where('email', Input::get('email'))->where('id', '<>', $id)->count() > 0) {
         return $this->panelInit->apiOutput(false, $this->panelInit->language['editStudent'], $this->panelInit->language['mailUsed']);
     }
     $User = User::find($id);
     $User->email = Input::get('email');
     $User->username = Input::get('username');
     $User->fullName = Input::get('fullName');
     if (Input::get('password') != "") {
         $User->password = Hash::make(Input::get('password'));
     }
     $User->studentRollId = Input::get('studentRollId');
     $User->gender = Input::get('gender');
     $User->address = Input::get('address');
     $User->phoneNo = Input::get('phoneNo');
     $User->mobileNo = Input::get('mobileNo');
     $User->studentClass = Input::get('studentClass');
     $User->transport = Input::get('transport');
     if (Input::get('birthday') != "") {
         $birthday = explode("/", Input::get('birthday'));
         $birthday = mktime(0, 0, 0, $birthday['0'], $birthday['1'], $birthday['2']);
         $User->birthday = $birthday;
     }
     if (Input::hasFile('photo')) {
         $fileInstance = Input::file('photo');
         $newFileName = "profile_" . $User->id . ".jpg";
         $file = $fileInstance->move('uploads/profile/', $newFileName);
         $User->photo = "profile_" . $User->id . ".jpg";
     }
     $User->save();
     if (input::has('academicYear')) {
         $studentAcademicYears = input::get('academicYear');
         $academicYear = studentAcademicYears::where('studentId', $id)->get();
         foreach ($academicYear as $value) {
             if (isset($studentAcademicYears[$value->academicYearId]) and $studentAcademicYears[$value->academicYearId] != $value->classId) {
                 $studentAcademicYearsUpdate = studentAcademicYears::where('studentId', $User->id)->where('academicYearId', $value->academicYearId)->first();
                 $studentAcademicYearsUpdate->classId = $studentAcademicYears[$value->academicYearId];
                 $studentAcademicYearsUpdate->save();
                 attendance::where('classId', $value->classId)->where('studentId', $User->id)->update(['classId' => $studentAcademicYears[$value->academicYearId]]);
                 examMarks::where('classId', $value->classId)->where('studentId', $User->id)->update(['classId' => $studentAcademicYears[$value->academicYearId]]);
                 if ($value->academicYearId == $User->studentAcademicYear) {
                     $User->studentClass = $studentAcademicYears[$value->academicYearId];
                     $User->save();
                 }
             }
         }
     }
     return $this->panelInit->apiOutput(true, $this->panelInit->language['editStudent'], $this->panelInit->language['studentModified'], $User->toArray());
 }
开发者ID:schoex,项目名称:Campusmate,代码行数:56,代码来源:StudentsController.php


注:本文中的input::has方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。