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


PHP e函数代码示例

本文整理汇总了PHP中e函数的典型用法代码示例。如果您正苦于以下问题:PHP e函数的具体用法?PHP e怎么用?PHP e使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: newQuestion

 public function newQuestion()
 {
     // POST İLE GÖNDERİLEN DEĞERLERİ ALALIM.
     $postData = Input::all();
     // FORM KONTROLLERİNİ BELİRLEYELİM
     $rules = array('title' => 'required|between:3,256', 'content' => 'required');
     // HATA MESAJLARINI OLUŞTURALIM
     $messages = array('title.required' => 'Lütfen sorunuzun başlığını yazın', 'title.between' => 'Soru başlığı minumum 3 maksimum 256 karakterden oluşabilir', 'content.required' => 'Lütfen sorunuza ait detayları yazın');
     // KONTROL (VALIDATION) İŞLEMİNİ GERÇEKLEŞTİRELİM
     $validator = Validator::make($postData, $rules, $messages);
     // EĞER VALİDASYON BAŞARISIZ OLURSA HATALARI GÖSTERELİM
     if ($validator->fails()) {
         // HATA MESAJLARI VE INPUT DEĞERLERİYLE FORMA  YÖNLENDİRELİM
         return Redirect::route('newQuestionForm')->withInput()->withErrors($validator->messages());
     } else {
         // SORUYU VERİTABANINA EKLEYELİM
         $question = new Questions();
         $question->user_id = Auth::user()->id;
         $question->title = e(trim($postData['title']));
         $question->content = e(trim($postData['content']));
         $question->created_at = date('Y-m-d H:i:s');
         $question->created_ip = Request::getClientIp();
         $question->save();
         // KULLANICIYI SORULARIN LİSTELENDİĞİ SAYFAYA YÖNLENDİRELİM
         return Redirect::route('allQuestions');
     }
 }
开发者ID:burak-tekin,项目名称:laravel-ornek-uygulama,代码行数:27,代码来源:QuestionsController.php

示例2: action_edit

 public function action_edit($id = null)
 {
     $student = Model_Student::find('first', ['where' => ['user_id' => $id]]);
     if (!$student) {
         $student = Model_Student::forge(['user_id' => $id]);
     }
     $val = Model_Student::validate('edit');
     if ($val->run()) {
         $student->user_id = Input::post('user_id');
         $student->year_level = Input::post('year_level');
         $student->course_id = Input::post('course_id');
         if ($student->save()) {
             Session::set_flash('success', e('Updated student #' . $id));
             Response::redirect('site/student');
         } else {
             Session::set_flash('error', e('Could not update student #' . $id));
         }
     } else {
         if (Input::method() == 'POST') {
             $student->user_id = $val->validated('user_id');
             $student->year_level = $val->validated('year_level');
             $student->course_id = $val->validated('course_id');
             Session::set_flash('error', $val->error());
         }
         $this->template->set_global('student', $student, false);
     }
     $this->template->title = "Students";
     $this->template->content = View::forge('site/student/edit');
 }
开发者ID:xXLXx,项目名称:ddc,代码行数:29,代码来源:student.php

示例3: save

 public function save()
 {
     if (!is_null($this->id)) {
         $sql = "UPDATE campaign_choices SET ";
     } else {
         $sql = "INSERT INTO campaign_choices SET ";
     }
     if (!is_null($this->choice)) {
         $sql .= "choice = \"" . e($this->choice) . "\", ";
     }
     if (!is_null($this->campaign)) {
         $sql .= "campaign_id = \"" . e($this->campaign) . "\", ";
     }
     $sql .= "parent = \"";
     if (!is_null($this->parent)) {
         $sql .= e($this->parent);
     } else {
         $sql .= '0';
     }
     $sql .= "\", ";
     if (!is_null($this->id)) {
         $sql .= 'id="' . e($this->id) . '" where id="' . $this->id . '"';
     } else {
         $sql = trim($sql, ', ');
     }
     Database::singleton()->query($sql);
     if (is_null($this->id)) {
         $this->id = Database::singleton()->lastInsertedID();
     }
 }
开发者ID:swat30,项目名称:safeballot,代码行数:30,代码来源:CampaignChoice.php

示例4: showOption

function showOption($option, $title)
{
    ?>
<input type="checkbox" name="<?php 
    echo $option;
    ?>
" value="1" id="<?php 
    echo $option;
    ?>
" <?php 
    if (get_option('surveys_' . $option)) {
        print " checked='checked'";
    }
    ?>
 />
<label for="<?php 
    echo $option;
    ?>
"><?php 
    e($title);
    ?>
</label><br />

<?php 
}
开发者ID:umairriaz90,项目名称:Daschug1,代码行数:25,代码来源:options.php

示例5: actualizarMisionVision

 public function actualizarMisionVision()
 {
     $response = 0;
     $id_centro = e(Input::get('id_centro'));
     $mision_centro = e(Input::get('mision_centro'));
     $vision_centro = e(Input::get('vision_centro'));
     $quienes_somos_centro = e(Input::get('quienes_somos_centro'));
     $centro = Centro::buscar_centro($id_centro);
     if (!is_null(Input::file('img_centro'))) {
         $file_img_vieja = $centro->img_centro;
         $file_img_centro = Input::file('img_centro');
         $img_centro = $file_img_centro->getClientOriginalName();
     } else {
         $img_centro = $centro->img_centro;
     }
     $response = Centro::actualizar_centro_mision_vision_quienes($id_centro, $mision_centro, $vision_centro, $quienes_somos_centro, $img_centro);
     if ($response == 1) {
         if (!is_null(Input::file('img_centro'))) {
             $file_img_centro->move('img', $file_img_centro->getClientOriginalName());
             File::delete('img/' . $file_img_vieja);
         }
         return Redirect::to(URL::previous())->with('mensaje', 'Centro de Investigacion Actualizado Insertado Correctamente');
     } else {
         return Redirect::to(URL::previous())->with('mensaje', 'Ha ocurrido un error');
     }
 }
开发者ID:cristianeto,项目名称:PortalCimogsys,代码行数:26,代码来源:MisionVisionController.php

示例6: save

 public function save()
 {
     if (isset($this->id) && $this->id != "") {
         if ($save = $this->sql->prepare("UPDATE wolfvtc_menu SET (name=?, url=?, weight=?) WHERE id=?")) {
             // update info
             $save->bind_param("ssii", e($this->name), e($this->url), intval($this->weight), intval($this->id));
             if ($save->execute) {
                 return TRUE;
             } else {
                 return FALSE;
             }
         } else {
             return FALSE;
         }
     } else {
         if ($save = $this->sql->prepare("INSERT INTO wolfvtc_menu (name, url, weight) VALUES (?, ?, ?)")) {
             // add new link
             $save->bind_param("ss", e($this->name), e($this->url), intval($this->weight));
             if ($save->execute) {
                 return TRUE;
             } else {
                 return FALSE;
             }
         } else {
             return FALSE;
         }
     }
 }
开发者ID:HumaneWolf,项目名称:WolfVTCStandalone,代码行数:28,代码来源:menu.php

示例7: render

 function render()
 {
     $json = json_encode($this->obj);
     $html =& Dispatcher::loadHelper('html');
     $html->headerNoCache();
     e($json);
 }
开发者ID:slab-php,项目名称:slab,代码行数:7,代码来源:json_result.php

示例8: rules

 /**
  * @return array
  * @throws Exception
  */
 public function rules()
 {
     $what = Input::get('what');
     $rules = ['description' => 'required|min:1,max:255', 'what' => 'required|in:withdrawal,deposit,transfer', 'amount' => 'numeric|required|min:0.01', 'date' => 'required|date', 'process_date' => 'date', 'book_date' => 'date', 'interest_date' => 'date', 'category' => 'between:1,255', 'amount_currency_id_amount' => 'required|exists:transaction_currencies,id', 'piggy_bank_id' => 'numeric', 'due_date' => 'date', 'payment_date' => 'date', 'internal_reference' => 'min:1,max:255', 'notes' => 'min:1,max:65536'];
     switch ($what) {
         case strtolower(TransactionType::WITHDRAWAL):
             $rules['source_account_id'] = 'required|exists:accounts,id|belongsToUser:accounts';
             $rules['destination_account_name'] = 'between:1,255';
             if (intval(Input::get('budget_id')) != 0) {
                 $rules['budget_id'] = 'exists:budgets,id|belongsToUser:budgets';
             }
             break;
         case strtolower(TransactionType::DEPOSIT):
             $rules['source_account_name'] = 'between:1,255';
             $rules['destination_account_id'] = 'required|exists:accounts,id|belongsToUser:accounts';
             break;
         case strtolower(TransactionType::TRANSFER):
             $rules['source_account_id'] = 'required|exists:accounts,id|belongsToUser:accounts|different:destination_account_id';
             $rules['destination_account_id'] = 'required|exists:accounts,id|belongsToUser:accounts|different:source_account_id';
             break;
         default:
             throw new FireflyException('Cannot handle transaction type of type ' . e($what) . '.');
     }
     return $rules;
 }
开发者ID:roberthorlings,项目名称:firefly-iii,代码行数:29,代码来源:JournalFormRequest.php

示例9: getNote

 public function getNote()
 {
     $Parsedown = new Parsedown();
     if ($this->note) {
         return $Parsedown->text(e($this->note));
     }
 }
开发者ID:blechdom,项目名称:inventory,代码行数:7,代码来源:Model.php

示例10: link

 /**
  * Построение ссылки
  *
  * @param	string	$url
  * @param	boolean	$absolute_flag
  * @param	string	$protocol
  * @return	string
  */
 public static function link($url = '', $absolute_flag = FALSE, $protocol = 'http')
 {
     $link = '';
     $cogear = getInstance();
     if (!$url) {
         return $protocol . '://' . SITE_URL . '/';
     } else {
         if (TRUE === $url) {
             return l() . cogear()->router->getUri();
         }
     }
     $url = parse_url($url);
     if ($absolute_flag) {
         $link .= $protocol . '://';
         $link .= SITE_URL;
     } elseif (defined('FOLDER')) {
         $link .= '/' . FOLDER;
     }
     isset($url['host']) && ($link = $protocol . '://' . $url['host']);
     isset($url['path']) && ($link .= '/' . ltrim($url['path'], '/'));
     isset($url['query']) && ($link .= '?' . $url['query']);
     isset($url['fragment']) && ($link .= '#' . $url['fragment']);
     event('link', $link);
     if (cogear()->input->get('splash') === '') {
         $link .= e();
     }
     return $link;
 }
开发者ID:brussens,项目名称:cogear2,代码行数:36,代码来源:Url.php

示例11: getIcon

 /**
  * @return string
  */
 public function getIcon()
 {
     if (!isset($this->icon)) {
         return;
     }
     return '<i class="fa fa-' . e($this->icon) . ' menu-icon"></i>';
 }
开发者ID:kodicms,项目名称:laravel-navigation,代码行数:10,代码来源:ItemDecorator.php

示例12: h

function h($value, $number = 1)
{
    if ($number < 0 || $number > 6) {
        $number = 1;
    }
    e($value, 'h' . $number, array('class' => 'heading-' . $number));
}
开发者ID:nasrulhazim,项目名称:training-php-mysql-intim-app,代码行数:7,代码来源:helpers.php

示例13: check

 static function check($res)
 {
     if ($res->errcode != 0) {
         Log . e("FAIL: " . json_encode($res));
         exit("Failed: " . json_encode($res));
     }
 }
开发者ID:vincent067,项目名称:openapi-demo-php,代码行数:7,代码来源:Auth.php

示例14: render

 /**
  * Render the notifications' script tag
  *
  * @return string
  * @internal param bool $flashed Whether to get the
  *
  */
 public function render()
 {
     $notifications = $this->session->get('toastr::notifications');
     if (!$notifications) {
         $notifications = [];
     }
     $output = '<script type="text/javascript">';
     $lastConfig = [];
     foreach ($notifications as $notification) {
         $config = $this->config->get('toastr.options');
         if (count($notification['options']) > 0) {
             // Merge user supplied options with default options
             $config = array_merge($config, $notification['options']);
         }
         // Config persists between toasts
         if ($config != $lastConfig) {
             $output .= 'toastr.options = ' . json_encode($config) . ';';
             $lastConfig = $config;
         }
         // Toastr output
         $output .= 'toastr.' . $notification['type'] . "('" . str_replace("'", "\\'", str_replace(['&lt;', '&gt;'], ['<', '>'], e($notification['message']))) . "'" . (isset($notification['title']) ? ", '" . str_replace("'", "\\'", htmlentities($notification['title'])) . "'" : null) . ');';
     }
     $output .= '</script>';
     return $output;
 }
开发者ID:petrovitch,项目名称:smoothing,代码行数:32,代码来源:Toastr.php

示例15: render

    public function render($__data)
    {
        ?>
<ul>
    <?php 
        foreach ($this->variable($__data, 'messages.success', [], '', [], 'traversable') as $i => $messagesSuccessItem) {
            ?>
    <li><?php 
            echo e($this->variable($messagesSuccessItem, 'message', [], '', null, 'string'));
            ?>
</li>
    <?php 
        }
        ?>
</ul>
<ul>
    <?php 
        foreach ($this->variable($__data, 'messages.error', [], '', [], 'traversable') as $i => $messagesErrorItem) {
            ?>
    <li><?php 
            echo e($this->variable($messagesErrorItem, 'message', [], '', null, 'string'));
            ?>
</li>
    <?php 
        }
        ?>
</ul><?php 
    }
开发者ID:visualturk,项目名称:lexicon,代码行数:28,代码来源:Lexicon_8a56d39220444b076005cc7b229a5b46.php


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