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


PHP Router::fullbaseUrl方法代码示例

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


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

示例1: login

 public function login()
 {
     if ($this->request->is('post')) {
         if ($this->Auth->login()) {
             if ($this->referer() == Router::fullbaseUrl() . Router::url(array('controller' => 'users', 'action' => 'login')) || $this->referer() == Router::fullbaseUrl() . Router::url(array('controller' => 'users', 'action' => 'newPassword'))) {
                 return $this->redirect($this->Auth->redirectUrl());
             } else {
                 return $this->redirect($this->referer());
             }
         } else {
             $this->Flash->error('Pseudo ou mot de passe invalide. Veuillez réessayer SVP');
         }
     }
 }
开发者ID:JuLaurent,项目名称:YouthBook.be,代码行数:14,代码来源:UsersController.php

示例2: add

 public function add()
 {
     if ($this->request->is('post')) {
         $this->autoRender = false;
         $this->loadModel('User');
         $user = $this->User->find('first', array('conditions' => array('User.session' => $_POST['session'])));
         $user_id = current(current($user));
         $base = $_REQUEST['image'];
         $image = $this->base64_to_jpeg($base, $_SERVER['DOCUMENT_ROOT'] . '/app/webroot/avatars/' . $user_id . '.jpg');
         $image_url = Router::fullbaseUrl() . '/app/webroot/avatars/' . $user_id . '.jpg';
         $this->User->id = $user_id;
         $this->User->saveField('avatar_url', $image_url);
         return '{"image_url": ' . json_encode($image_url) . "}";
     }
 }
开发者ID:max-makeychik,项目名称:chat-api,代码行数:15,代码来源:ImageController.php

示例3: view

 public function view($mv_id = null, $id = null)
 {
     //動画基本情報の取得
     $this->Post->id = $id;
     $view_ret = $this->Post->findById($id);
     $this->set('post', $view_ret);
     $this->set('devFlg', $view_ret['Post']['dev_flg']);
     $this->set('id', $id);
     $this->set('post_id', $mv_id);
     $baseUrl = Router::fullbaseUrl();
     $webroot = $this->webroot;
     $url = $baseUrl . $webroot;
     $this->set('root_url', $url);
     $params = array('conditions' => array('Fav.user_id' => $this->Auth->user('id'), 'Fav.post_id' => $id));
     //関連動画の表示
     $tagIds = array();
     for ($i = 0; $i < count($view_ret['Tag']); $i++) {
         array_push($tagIds, $view_ret['Tag'][$i]['id']);
     }
     $paramsRelated = array('conditions' => array('PostsTag.tag_id' => $tagIds), 'order' => 'rand()', 'limit' => 3);
     $this->set('relatedPosts', $this->PostsTag->find('all', $paramsRelated));
     //ユーザーがその動画に対していいねを押したかどうかのフラグ。1以上の場合いいね済み
     $count = 1 <= $this->Fav->find('count', $params) ? 1 : 0;
     $this->set('favFlag', $count);
     if ($this->request->is('get')) {
         $this->Post->updateAll(array('Post.play_num' => 'Post.play_num + 1'), array('Post.id' => $id));
     }
     //お気に入り登録処理
     if ($this->request->is('post')) {
         if (empty($this->Auth->user())) {
             $this->redirect(array('controller' => 'Users', 'action' => 'login'));
         }
         $this->request->data['Fav']['user_id'] = $this->Auth->user('id');
         if ($this->Post->updateAll(array('Post.fav' => 'Post.fav + 1'), array('Post.id' => $this->request->data['Fav']['post_id'])) && $this->Fav->save($this->request->data)) {
             $this->redirect('/posts/view/' . $mv_id . '/' . $id);
         } else {
         }
     }
 }
开发者ID:akiraisomura,项目名称:ltshare_gh,代码行数:39,代码来源:PostsController.php

示例4: beforeFilter

 /**
  * To filter url request
  * @author Gaurav
  */
 public function beforeFilter()
 {
     $headersInformation = getallheaders();
     // admin email
     $this->set('AdminEmail', AdminEmail);
     if (isset($this->params['prefix']) && $this->params['prefix'] == 'admin') {
         //$this->Auth->loginRedirect = array('plugin' => false, 'controller' => 'dashboard', 'action' => 'index');
         $this->layout = 'admin';
         AuthComponent::$sessionKey = 'Auth.User';
         $this->isAdmin = TRUE;
         Configure::write('isAdmin', TRUE);
     } else {
         //$this->Auth->loginRedirect = array('plugin' => false, 'controller' => 'pages', 'action' => 'home');
         $this->layout = 'front';
         // get group change request status
         $bizOwnerId = $this->Session->read('Auth.Front.BusinessOwners.id');
         //$crCount = $this->Session->read('Auth.Front.BusinessOwners.group_change');
         //$this->set(compact('crCount'));
         Configure::write('isAdmin', FALSE);
         AuthComponent::$sessionKey = 'Auth.Front';
     }
     $roleType = $this->Session->read('Auth.User.user_type');
     $this->set('common', $this->Common);
     $frontUserRole = $this->Session->read('Auth.Front.user_type');
     $isUserLogin = $frontUserRole == "businessOwner" ? true : false;
     $this->set(compact("isUserLogin"));
     $loginUserId = $this->Session->read('Auth.Front.id');
     $this->set(compact("loginUserId"));
     if (empty($headersInformation['HASHKEY']) && $this->params['prefix'] != 'api') {
         // redirect session after login
         $checkUrl = Router::fullbaseUrl() . $this->here;
         if (strpos($checkUrl, Configure::read('SITE_URL') . 'referrals/referralDetails/sent/') !== false) {
             $this->Session->write('BackUrlAfterLogin', $checkUrl);
         } elseif (strpos($checkUrl, Configure::read('SITE_URL') . 'referrals/referralDetails/received/') !== false) {
             $this->Session->write('BackUrlAfterLogin', $checkUrl);
         } elseif (strpos($checkUrl, Configure::read('SITE_URL') . 'messages/viewMessage/') !== false) {
             $this->Session->write('BackUrlAfterLogin', $checkUrl);
         } elseif (strpos($checkUrl, Configure::read('SITE_URL') . 'reviews/index') !== false) {
             $this->Session->write('BackUrlAfterLogin', $checkUrl);
         } elseif (strpos($checkUrl, Configure::read('SITE_URL') . 'meetings') !== false) {
             $this->Session->write('BackUrlAfterLogin', $checkUrl);
         }
         if (empty($roleType)) {
             $this->Auth->allow(array('admin_login', 'admin_forgotPassword', 'admin_resetPassword', 'home', 'login', 'subscribe', 'aboutUs', 'contactUs', 'privacyPolicy', 'termsOfServices', 'careers', 'partners', 'faq', 'faqView', 'faqSearch', 'getCountryList', 'getCountryName', 'getStateList', 'getStateName', 'trainingVideoReminderMail', 'recurringTransaction', 'rating', 'deactivateUser', 'getProfessionList'));
         }
     } else {
         if ($this->params['prefix'] == 'api') {
             $this->RequestHandler->ext = Configure::read('SERVICEFORMAT');
             if (!isset($headersInformation['HASHKEY']) || $headersInformation['HASHKEY'] != Configure::read('HASHKEY')) {
                 echo json_encode(array('code' => Configure::read('RESPONSE_ERROR'), 'message' => 'Invalid Hash Key'));
                 die;
             }
             $this->Auth->allow($this->action);
             //API Post Data in Json
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $this->__getPostContent();
             }
             //fetch the headers data
             $this->__getHeaderInformation();
         }
     }
     // Login user get counter for different entity (ex- message, referrals etc.)
     if (empty($this->request->data) && empty($this->request->form)) {
         $this->Common->clearDropzoneData();
     }
     $messageCounter = 0;
     $referalCounter = 0;
     if ($loginUserId != "") {
         $loginUserId = $this->Encryption->decode($loginUserId);
         $userGroup = $this->Groups->getUserGroupId($loginUserId);
         // logout user after shuffling
         $beforeShuffling = $this->Session->read('Auth.Front.BusinessOwner.group_id');
         $afterShuffling = $userGroup['BusinessOwner']['group_id'];
         if (!empty($beforeShuffling) && $beforeShuffling != $afterShuffling) {
             $this->Auth->logout();
         }
         if ($this->action == "viewMessage") {
             if (isset($this->params->pass[0])) {
                 $messageId = $this->Encryption->decode($this->params->pass[0]);
                 $this->loadModel('MessageRecipient');
                 $this->MessageRecipient->updateAll(array('MessageRecipient.is_read' => 1, 'MessageRecipient.is_total_read' => 1), array('MessageRecipient.message_id' => $messageId, 'MessageRecipient.recipient_user_id' => $loginUserId));
             }
         }
         if ($this->action == "referralDetails") {
             if (isset($this->params->pass[0]) && isset($this->params->pass[1])) {
                 if ($this->params->pass[0] == "received") {
                     $referralId = $this->Encryption->decode($this->params->pass[1]);
                     $this->loadModel('ReceivedReferral');
                     $this->ReceivedReferral->updateAll(array('ReceivedReferral.is_read' => 1, 'ReceivedReferral.is_total_read' => 1), array('ReceivedReferral.id' => $referralId, 'ReceivedReferral.to_user_id' => $loginUserId));
                 }
             }
         }
         $messageCounter = $this->Common->unreadCounter('messages', $loginUserId);
         $referalCounter = $this->Common->unreadCounter('referrals', $loginUserId);
         $this->set('userGroup', $userGroup['BusinessOwner']['group_id']);
         // get profile picture path
//.........这里部分代码省略.........
开发者ID:yogesha3,项目名称:yogesh-test,代码行数:101,代码来源:AppController.php

示例5: initTags

 /**
  * 初期設定 タグ
  *
  * @param int $languageId 言語ID
  * @param string $pluginName プラグイン名
  * @return void
  */
 public function initTags($languageId, $pluginName = null)
 {
     if ($pluginName === null) {
         $pluginName = Current::read('Plugin.name');
     }
     $from = SiteSettingUtil::read('Mail.from');
     $fromName = SiteSettingUtil::read('Mail.from_name', null, $languageId);
     $siteName = SiteSettingUtil::read('App.site_name', null, $languageId);
     $bodyHeader = SiteSettingUtil::read('Mail.body_header', null, $languageId);
     $signature = SiteSettingUtil::read('Mail.signature', null, $languageId);
     $siteTimezone = (new NetCommonsTime())->getSiteTimezone();
     $now = NetCommonsTime::getNowDatetime();
     $date = new DateTime($now);
     $date->setTimezone(new DateTimeZone($siteTimezone));
     $siteNow = $date->format('Y/m/d H:i:s');
     $this->assignTag('X-FROM_EMAIL', $from);
     $this->assignTag('X-FROM_NAME', $fromName);
     $this->assignTag('X-SITE_NAME', $siteName);
     $this->assignTag('X-SITE_URL', Router::fullbaseUrl());
     $this->assignTag('X-PLUGIN_NAME', $pluginName);
     $this->assignTag('X-BLOCK_NAME', Current::read('Block.name'));
     $this->assignTag('X-TO_DATE', $siteNow);
     $this->assignTag('X-BODY_HEADER', $bodyHeader);
     $this->assignTag('X-SIGNATURE', $signature);
     // X-ROOMタグ
     $this->setXRoom($languageId);
 }
开发者ID:NetCommons3,项目名称:Mails,代码行数:34,代码来源:NetCommonsMailAssignTag.php

示例6: register

 public function register()
 {
     $this->set('phone_types', $this->PhoneType->findAll());
     $this->set('states', $this->State->findAllLongNames());
     if ($this->request->is('post') || $this->request->is('put')) {
         $this->request->data['User']['role_id'] = 1;
         $this->request->data['User']['status_id'] = 3;
         if ($this->Employer->User->saveAll($this->request->data, array('validation' => 'only'))) {
             $organization = $this->Organization->checkAndCreate($this->request->data, 1);
             unset($this->request->data['Organization']);
             $this->request->data['Employer']['organization_id'] = $organization['Organization']['id'];
             $employer = $this->request->data['Employer'];
             unset($this->request->data['Employer']);
             $this->Employer->User->saveAll($this->request->data, array('validation' => false));
             $employer['user_id'] = $this->Employer->User->getLastInsertID();
             $this->Employer->save($employer);
             $this->Auth->login();
             $this->Employer->Company->checkAndCreate($organization);
             $this->Employer->User->Request->create();
             $this->Employer->User->Request->save(array('Request' => array('request_type_id' => 1)));
             $request_id = $this->Employer->User->Request->getInsertId();
             $request = $this->Employer->User->Request->findById($request_id);
             $Email = new CakeEmail();
             $Email->config('gmail');
             $Email->to($this->Auth->user('email'));
             $Email->template('welcome', 'welcome');
             $Email->emailFormat('html');
             $confirm_url = Router::fullbaseUrl() . "/confirm/" . $request['Request']['url'];
             $Email->subject('Welcome To FitIn.Today!');
             $Email->viewVars(array('confirm_email' => $confirm_url));
             $Email->send();
             $this->Session->setFlash(__('Welcome! Please check your email to confirm your address'), 'alert', array('plugin' => 'BoostCake', 'class' => 'alert-success'));
             $applicant_url = $this->Session->read('applicant_url');
             $this->Session->delete('applicant_url');
             if (!empty($applicant_url)) {
                 $this->redirect(array('controller' => 'applicants', 'action' => 'view', $applicant_url));
             }
             $this->redirect(array('controller' => 'employers', 'action' => 'profile'));
         }
     }
 }
开发者ID:desnudopenguino,项目名称:fitin,代码行数:41,代码来源:EmployersController.php

示例7: add

 public function add()
 {
     if (empty($this->request->data)) {
         $this->redirect(array('action' => 'index', 'controller' => 'recordtrac'));
     }
     App::uses('CakeEmail', 'Network/Email');
     if (!empty($this->request->data)) {
         $requestID = filter_var($this->request->data["Record"]["request_id"], FILTER_VALIDATE_INT);
         if ($this->Record->validates()) {
             //clean filename
             $this->request->data["Record"]["filename"]["name"] = $this->FileSanitize->sanitize($this->request->data["Record"]["filename"]["name"]);
             // it validated logic
             if ($this->Record->save($this->request->data)) {
                 //determine type of record
                 $recordType = '';
                 $url = '';
                 if ($this->request->data["Record"]["url"] != '') {
                     $recordType = "url";
                     $url = $this->request->data["Record"]["url"];
                 } elseif ($this->request->data["Record"]["access"] != '') {
                     $recordType = "offline";
                     $url = filter_var($this->request->data["Record"]["access"], FILTER_SANITIZE_STRING);
                 } else {
                     $recordType = "file";
                     $url = Router::fullbaseUrl() . "/files/record/filename/" . $this->Record->id . "/" . $this->request->data["Record"]["filename"]["name"];
                 }
                 //get the subscribers
                 $this->loadModel('Subscriber');
                 $subscribers = $this->Subscriber->find('all', array('conditions' => array('Subscriber.request_id' => $requestID)));
                 //get the point of contact
                 $this->loadModel('Owner');
                 $owner = $this->Owner->find('first', array('conditions' => array('Owner.request_id' => $requestID)));
                 foreach ($subscribers as $subscriber) {
                     //make sure they are set to receive notifications, and have a valid email
                     if ($subscriber["Subscriber"]["should_notify"] == 1 && $subscriber["User"]["email"] != '') {
                         //email subscriber
                         $Email = new CakeEmail();
                         $Email->template('requestupdated')->emailFormat('html')->to($subscriber["User"]["email"])->from($this->getfromEmail())->bcc($this->getBccEmail())->subject($this->getAgencyName() . ' Public Disclosure Request #' . $requestID . " - Updated")->viewVars(array('agencyName' => $this->getAgencyName(), 'page' => '/requests/view/' . $requestID, 'ownerEmail' => $owner["User"]["email"], 'requestID' => $requestID, 'unsubscribe' => '/requests/unsubscribe/' . $subscriber["Subscriber"]["id"], 'description' => $this->request->data["Record"]["description"], 'fileupload' => $recordType, 'url' => $url))->send();
                     }
                 }
                 $this->Session->setFlash("<h4>Success</h4><p>Your record has been added and subscribers have been notified by email.</p>", 'success');
             } else {
                 if ($this->request->data["Record"]["filename"]["error"] == 1) {
                     $this->Session->setFlash("<h4>ERROR</h4><p>File exceeds maximum upload size. No file uploaded.</p>", 'danger');
                 } elseif ($this->request->data["Record"]["filename"]["error"] == 0) {
                     $errors = $this->Record->validationErrors;
                     foreach ($errors["filename"] as $error) {
                         $this->Session->setFlash("<h4>ERROR</h4><p>" . $error . "</p>", 'danger');
                     }
                 }
             }
         } else {
             // didn't validate logic
             $errors = $this->Record->validationErrors;
             foreach ($errors["filename"] as $error) {
                 $this->Session->setFlash("<h4>ERROR</h4><p>" . $error . "</p>", 'danger');
             }
         }
         unset($this->request->data);
         $this->redirect(array('action' => 'view', 'controller' => 'requests', $requestID));
     }
 }
开发者ID:n7k1,项目名称:recordtrac-cakephp,代码行数:62,代码来源:RecordsController.php

示例8: array

<?php

$config = array('Elfinder' => array('title' => __('Elfinder File Manager'), 'width' => 900, 'height' => 500, 'resizable' => 'yes', 'window_url' => Router::fullbaseUrl() . '/my_controller/elfinder', 'connector_url' => Router::fullbaseUrl() . '/my_controller/connector', 'locale' => 'en', 'options' => array('roots' => array(array('driver' => 'LocalFileSystem', 'URL' => Router::fullbaseUrl() . '/img/Uploads', 'path' => IMAGES . 'Uploads', 'accessControl' => 'access', 'attributes' => array(array('pattern' => '!\\.html$!', 'hidden' => true)), 'tmbPath' => 'tumbnails', 'uploadOverwrite' => false)))));
开发者ID:Raunter,项目名称:Tinymce-Image-Upload-Cakephp,代码行数:3,代码来源:elfinder.php

示例9: __construct

 public function __construct()
 {
     $this->admin = AuthComponent::user('isAdmin');
     //info
     $this->local = Router::fullbaseUrl();
     //echo $this->getEditionPage();
     $this->arr2 = json_decode(file_get_contents(APP . 'cms/base.json'), true);
 }
开发者ID:hupla78,项目名称:Nadia,代码行数:8,代码来源:AppController.php

示例10: login

 public function login()
 {
     //debug($this->request);
     $baseUrl = Router::fullbaseUrl();
     $webroot = $this->webroot;
     $url = $baseUrl . $webroot;
     $this->set('root_url', $url);
     $this->set('webroot', $webroot);
     if ($this->request->is('post')) {
         if ($this->Auth->login()) {
             $this->set('user', $this->Auth->user());
             return $this->redirect(array('controller' => 'Posts', 'action' => 'index'));
         } else {
             $this->Session->setFlash('ユーザー名とパスワードの組み合わせが違います。');
         }
     }
 }
开发者ID:akiraisomura,项目名称:ltshare_gh,代码行数:17,代码来源:UsersController.php

示例11: confirm

 /**
  * confirm is the action that a user goes to to request an email confirmation
  */
 public function confirm()
 {
     if ($this->request->is('post')) {
         $this->User->Request->create();
         $this->User->Request->save(array('Request' => array('request_type_id' => 1)));
         $request_id = $this->User->Request->getInsertId();
         $request = $this->User->Request->findById($request_id);
         $Email = new CakeEmail();
         $Email->to($this->Auth->user('email'));
         $Email->subject('FitIn.Today Email Confirmation');
         $Email->config('gmail');
         $Email->send("Welcome to FitIn.Today! Please confirm your email address by clicking the link below. \n\n " . Router::fullbaseUrl() . "/confirm/" . $request['Request']['url']);
         $this->Session->setFlash(__('A confirmation email has been sent'), 'alert', array('plugin' => 'BoostCake', 'class' => 'alert-success'));
     }
 }
开发者ID:desnudopenguino,项目名称:fitin,代码行数:18,代码来源:UsersController.php

示例12: edit

 /**
  * 編集
  *
  * @return	void
  * @access	public
  */
 public function edit($postID = null)
 {
     //除外処理
     if (empty($postID)) {
         $postID = $this->request->params['id'];
     }
     if (empty($postID)) {
         $this->setMessage('無効なIDです。', true);
         $this->redirect(array('action' => 'index'));
     }
     /* 各種データを取得する  */
     //携帯投稿TBLからデータを取得する
     $mobilePostData = $this->MobilePost->find('first', array('conditions' => array('MobilePost.id' => $postID)));
     //データの取得
     $postData = $this->BlogPost->find('first', array('conditions' => array('BlogPost.id' => $mobilePostData['MobilePost']['blog_post_id'])));
     if (empty($postData)) {
         $this->setMessage('データが取得できませんでした。', true);
         $this->redirect(array('action' => 'index'));
     }
     //画像を取得する。
     if (!empty($mobilePostData['MobilePost']['file'])) {
         $thumImgName = 'thum_' . $mobilePostData['MobilePost']['file'];
         $saveThumURL = 'files/mobile_post/' . $thumImgName;
         $mobilePostImg = Router::fullbaseUrl() . $this->request->webroot . $saveThumURL;
         $this->set('mobilePostImg', $mobilePostImg);
     }
     //モバイルポスト設定を取得する。
     $mobilePostConfig = $this->MobilePostConfig->find('first', array('conditions' => array('blog_content_id' => $postData['BlogPost']['blog_content_id'])));
     $this->set('mobilePostConfig', $mobilePostConfig);
     //ブログ設定取得
     $blogContentData = $this->BlogContent->find('first', array('conditions' => array('BlogContent.id' => $postData['BlogPost']['blog_content_id'])));
     /* フォーム生成用にデータを整理する */
     //セレクトボックスの為に配列化する。
     $categoryOptions = $this->MobilePost->getCategoryOptions($postData['BlogPost']['blog_content_id']);
     $this->set('categoryOptions', $categoryOptions);
     //タグデータを取得する。
     $tagOptions = $this->MobilePost->getTagOptions();
     $this->set('tagOptions', $tagOptions);
     /* データの受信処理 */
     //POSTボタン押下後
     if (!empty($this->request->data)) {
         /* データの整理 */
         //テキストエリアの改行
         if (!empty($this->request->data['BlogPost']['content'])) {
             $this->request->data['BlogPost']['content'] = nl2br($this->request->data['BlogPost']['content']);
         } else {
             $this->request->data['BlogPost']['content'] = '';
             //変数定義だけしないとエラーになる?
         }
         if (!empty($this->request->data['BlogPost']['detail'])) {
             $this->request->data['BlogPost']['detail'] = nl2br($this->request->data['BlogPost']['detail']);
         }
         //noを生成
         $this->request->data['BlogPost']['no'] = $postData['BlogPost']['no'];
         //公開期日
         if (!empty($this->request->data['BlogPost']['publish_begin_date'])) {
             $this->request->data['BlogPost']['publish_begin'] = $this->request->data['BlogPost']['publish_begin_date'] . " " . $this->request->data['BlogPost']['publish_begin_time'];
         } else {
             $this->request->data['BlogPost']['publish_begin'] = null;
         }
         if (!empty($this->request->data['BlogPost']['publish_end_date'])) {
             $this->request->data['BlogPost']['publish_end'] = $this->request->data['BlogPost']['publish_end_date'] . " " . $this->request->data['BlogPost']['publish_end_time'];
         } else {
             $this->request->data['BlogPost']['publish_end'] = null;
         }
         //投稿日
         $this->request->data['BlogPost']['posts_date'] = $this->request->data['BlogPost']['posts_date_date'] . " " . $this->request->data['BlogPost']['posts_date_time'];
         //携帯投稿専用のデータ整形
         $mobileData = array();
         $mobileData = $this->request->data;
         /* 画像に関する処理 */
         //画像の削除があれば消してしまう。
         if (!empty($this->request->data['MobilePost']['img_delete'][0]) && $this->request->data['MobilePost']['img_delete'][0] == 'yes') {
             //まずファイルの削除
             $this->MobilePost->removeMobilePostImg($mobilePostData);
             //UNSET
             if (!empty($mobilePostData['MobilePost']['file'])) {
                 $mobileData['MobilePost']['file'] = '';
                 $this->MobilePost->id = $postID;
                 $this->MobilePost->saveField('file', '');
                 //明示的に空にする
             }
             //削除指示がない場合で、前の画像が残っていれば指定場所にタグを挿入する。
         } else {
             //元々の画像があれば画像名を取得する。
             if (!empty($mobilePostData['MobilePost']['file'])) {
                 //画像URL整形
                 $webrootPath = Router::fullbaseUrl() . $this->request->webroot;
                 $saveURL = $webrootPath . '/files/mobile_post/' . $mobilePostData['MobilePost']['file'];
                 $saveThumURL = $webrootPath . '/files/mobile_post/thum_' . $mobilePostData['MobilePost']['file'];
                 $imgTag = "<div class='mobilePostImage'><a href='{$saveURL}' rel='colorbox' title=''><img src='{$saveThumURL}' /></a></div>";
                 //画像の挿入箇所確認と挿入実行
                 switch ($mobileData['MobilePost']['file_position']) {
                     case 0:
//.........这里部分代码省略.........
开发者ID:hiniarata,项目名称:MobilePost,代码行数:101,代码来源:MobilePostsController.php


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