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


PHP low函数代码示例

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


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

示例1: mode

 function mode($mode = 'full')
 {
     if (in_array($mode, array('full', 'lite'))) {
         $this->Session->write("Acl.Mode", low($mode));
     }
     $this->redirect($this->referer('/' . $this->PluginName . '/acos'));
 }
开发者ID:javan-it-services,项目名称:internal,代码行数:7,代码来源:acl_admin_controller.php

示例2: beforeFilter

 function beforeFilter()
 {
     /*
     
     if ( !isset($this->params['lang']) && !$this->Session->check('langSes') ) {
     	
     	$this->params['lang'] = $defaultLang;
     	$this->Session->write('langSes',$defaultLang);
     
     } elseif ( !isset($this->params['lang']) && $this->Session->check('langSes') ) {
     	$this->params['lang'] = $this->Session->read('langSes');
     } 
     
     Configure::write('Config.language', $this->params['lang']);
     $this->Session->write('langSes',$this->params['lang']);
     */
     if (isset($this->Auth)) {
         if ($this->viewPath == 'pages' && $this->params['action'] != 'admin_index') {
             $this->Auth->allow('*');
         } else {
             $this->Auth->authorize = 'controller';
             if (in_array(low($this->params['controller']), $this->publicControllers)) {
                 //$this->Auth->allow('*');
                 $this->Auth->deny('pages/admin_index');
             }
         }
         $this->Auth->loginAction = array('admin' => false, 'controller' => 'users', 'action' => 'login');
     }
 }
开发者ID:kondrat,项目名称:ez.go,代码行数:29,代码来源:app_controller.php

示例3: merge

 /**
  * This function can be thought of as a hybrid between PHP's array_merge and array_merge_recursive. The difference
  * to the two is that if an array key contains another array then the function behaves recursive (unlike array_merge)
  * but does not do if for keys containing strings (unlike array_merge_recursive). See the unit test for more information.
  *
  * Note: This function will work with an unlimited amount of arguments and typecasts non-array parameters into arrays.
  *
  * @param array $arr1 Array to be merged
  * @param array $arr2 Array to merge with
  * @return array Merged array
  * @access public
  */
 function merge($arr1, $arr2 = null)
 {
     $args = func_get_args();
     if (is_a($this, 'set')) {
         $backtrace = debug_backtrace();
         $previousCall = low($backtrace[1]['class'] . '::' . $backtrace[1]['function']);
         if ($previousCall != 'set::merge') {
             $r =& $this->value;
             array_unshift($args, null);
         }
     }
     if (!isset($r)) {
         $r = (array) current($args);
     }
     while (($arg = next($args)) !== false) {
         if (is_a($arg, 'set')) {
             $arg = $arg->get();
         }
         foreach ((array) $arg as $key => $val) {
             if (is_array($val) && isset($r[$key]) && is_array($r[$key])) {
                 $r[$key] = Set::merge($r[$key], $val);
             } elseif (is_int($key)) {
                 $r[] = $val;
             } else {
                 $r[$key] = $val;
             }
         }
     }
     return $r;
 }
开发者ID:sukhjeet81,项目名称:capuchn,代码行数:42,代码来源:set.php

示例4: afterFind

 function afterFind(&$Model, $results, $primary)
 {
     if ($this->__settings[$Model->name]['countchild_enabled'] === false) {
         return $results;
     }
     foreach ($results as $key => $val) {
         /* Loop results */
         if (!is_array($val)) {
             continue;
             /* Should never happen */
         }
         foreach ($val as $k => $v) {
             if ($k == $Model->name) {
                 /* This is the parent dataset to populate, so skip */
                 continue;
             }
             if (empty($v)) {
                 $results[$key][$Model->name][low($k) . $this->__settings[$Model->name]['count_field_suffix']] = 0;
             } elseif (!isset($v[0])) {
                 /* HasOne relationship */
                 $results[$key][$Model->name][low($k) . $this->__settings[$Model->name]['count_field_suffix']] = 1;
             } else {
                 /* HasMany relationship */
                 $results[$key][$Model->name][low($k) . $this->__settings[$Model->name]['count_field_suffix']] = count($v);
             }
         }
     }
     $this->__settings[$Model->name]['countchild_enabled'] = false;
     return $results;
 }
开发者ID:kouak,项目名称:ircube,代码行数:30,代码来源:child_count.php

示例5: slug

 /**
  * Returns a string with all spaces converted to $replacement and non word characters removed.
  *
  * @param string $string
  * @param string $replacement
  * @return string
  * @static
  */
 static function slug($string, $replacement = '-')
 {
     $string = trim($string);
     $map = array('/à|á|å|â|ä/' => 'a', '/è|é|ê|ẽ|ë/' => 'e', '/ì|í|î/' => 'i', '/ò|ó|ô|ø/' => 'o', '/ù|ú|ů|û/' => 'u', '/ç|č/' => 'c', '/ñ|ň/' => 'n', '/ľ/' => 'l', '/ý/' => 'y', '/ť/' => 't', '/ž/' => 'z', '/š/' => 's', '/æ/' => 'ae', '/ö/' => 'oe', '/ü/' => 'ue', '/Ä/' => 'Ae', '/Ü/' => 'Ue', '/Ö/' => 'Oe', '/ß/' => 'ss', '/[^\\w\\s]/' => ' ', '/\\s+/' => $replacement, String::insert('/^[:replacement]+|[:replacement]+$/', array('replacement' => preg_quote($replacement, '/'))) => '');
     $string = preg_replace(array_keys($map), array_values($map), $string);
     return low($string);
 }
开发者ID:uuking,项目名称:wildflower,代码行数:15,代码来源:app_helper.php

示例6: beforeFilter

 function beforeFilter()
 {
     $defaultLang = Configure::read('Languages.default');
     //debug(env('HTTP_ACCEPT_LANGUAGE'));
     if (!isset($this->params['lang']) && !$this->Session->check('langSes')) {
         $this->params['lang'] = $defaultLang;
         $this->Session->write('langSes', $defaultLang);
     } elseif (!isset($this->params['lang']) && $this->Session->check('langSes')) {
         $this->params['lang'] = $this->Session->read('langSes');
         //$this->Session->write('testSes', 'case2');
     }
     //debug(Configure::read('Config.language'));
     //debug(Configure::version());
     Configure::write('Config.language', $this->params['lang']);
     $this->Session->write('langSes', $this->params['lang']);
     if ($this->name != 'App' && !in_array($this->params['lang'], Configure::read('Languages.all'))) {
         unset($this->params['lang']);
         $this->Session->del('langSes');
         $this->Session->setFlash(__('Whoops, not a valid language.', true));
         $this->redirect('/', 301, true);
     }
     if (isset($this->Auth)) {
         if ($this->viewPath == 'pages' && $this->params['action'] != 'admin_index') {
             $this->Auth->allow('*');
         } else {
             $this->Auth->authorize = 'controller';
             if (in_array(low($this->params['controller']), $this->publicControllers)) {
                 //$this->Auth->allow('*');
                 $this->Auth->deny('pages/admin_index');
             }
         }
         $this->Auth->loginAction = array('admin' => false, 'controller' => 'users', 'action' => 'login');
     }
 }
开发者ID:kondrat,项目名称:chat,代码行数:34,代码来源:app_controller.php

示例7: validateTitle

 function validateTitle($value)
 {
     if (!empty($value) && strpos(low($value['title']), 'title-') === 0) {
         return true;
     }
     return false;
 }
开发者ID:kaz0636,项目名称:openflp,代码行数:7,代码来源:model.test.php

示例8: beforeFilter

 function beforeFilter()
 {
     // Do not continue if there is an indication of a previous successful installation
     if (file_exists(APP . 'do_not_remove')) {
         $this->redirect(array('controller' => 'home', 'action' => 'index'));
     }
     $this->checkPreReqs();
     if (!empty($this->data)) {
         $this->Installer->data = $this->data;
     }
     // auto-calculate the total number of steps using some convention magic
     $steps = count(array_filter(get_class_methods('InstallerController'), array($this, "__getSteps")));
     $this->action = low($this->action);
     switch ($this->action) {
         case 'setup_db':
             $this->pageTitle = "Database Setup";
             $step = 1;
             break;
         case 'setup_auth':
             $this->pageTitle = "Authentication";
             $step = 2;
             break;
         case 'thanks':
             $this->pageTitle = "Installation Complete!";
             return;
         case $this->redirect(array('action' => 'setup_db')):
     }
     // set the right set of form validation rules for the current step
     $this->Installer->step($step);
     $this->pageTitle .= " [{$step}/{$steps}]";
     $this->set('submit', $step < $steps ? 'Next >>' : 'Finish');
     $this->set('url', array('url' => array('controller' => 'installer', 'action' => $this->action)));
     $this->set(compact('step', 'steps'));
 }
开发者ID:maverick2041,项目名称:wpkgexpress,代码行数:34,代码来源:installer_controller.php

示例9: season

function season($indoor)
{
    // The configuration settings values have "0" for the year, to facilitate form input
    $today = date('0-m-d');
    $today_wrap = date('1-m-d');
    // Build the list of applicable seasons
    $seasons = Configure::read('options.season');
    unset($seasons['None']);
    if (empty($seasons)) {
        return 'None';
    }
    foreach (array_keys($seasons) as $season) {
        $season_indoor = Configure::read("season_is_indoor.{$season}");
        if ($indoor != $season_indoor) {
            unset($seasons[$season]);
        }
    }
    // Create array of which season follows which
    $seasons = array_values($seasons);
    $seasons_shift = $seasons;
    array_push($seasons_shift, array_shift($seasons_shift));
    $next = array_combine($seasons, $seasons_shift);
    // Look for the season that has started without the next one starting
    foreach ($next as $a => $b) {
        $start = Configure::read('organization.' . Inflector::slug(low($a)) . '_start');
        $end = Configure::read('organization.' . Inflector::slug(low($b)) . '_start');
        // Check for a season that wraps past the end of the year
        if ($start > $end) {
            $end[0] = '1';
        }
        if ($today >= $start && $today < $end || $today_wrap >= $start && $today_wrap < $end) {
            return $a;
        }
    }
}
开发者ID:roboshed,项目名称:Zuluru,代码行数:35,代码来源:zuluru.php

示例10: beforeFilter

 function beforeFilter()
 {
     if (isset($this->Auth)) {
         if (is_null($this->Auth->User())) {
             $cookie = $this->Cookie->read('Auth.User');
             if (!is_null($cookie)) {
                 //debug($cookie);
                 if ($this->Auth->login($cookie)) {
                     //  Clear auth message, just in case we use it.
                     $this->Session->del('Message.auth');
                     $this->redirect('/users/index');
                 } else {
                     // Delete invalid Cookie
                     $this->Cookie->del('Auth.User');
                 }
             }
         }
         if ($this->viewPath == 'pages') {
             $this->Auth->allow('*');
         } else {
             $this->Auth->authorize = 'controller';
             if (in_array(low($this->params['controller']), $this->publicControllers)) {
                 $this->Auth->allow('*');
             }
         }
     }
 }
开发者ID:kondrat,项目名称:agift,代码行数:27,代码来源:app_controller.php

示例11: initialize

 /**
  * Controllers initialize function.
  */
 function initialize(&$controller, $settings = array())
 {
     $this->Controller =& $controller;
     $settings = array_merge(array(), (array) $settings);
     $this->modelName = $this->Controller->modelClass;
     $this->prettyModelName = low(Inflector::humanize(Inflector::underscore(Inflector::pluralize($this->modelName))));
 }
开发者ID:rchavik,项目名称:infinitas,代码行数:10,代码来源:mass_action.php

示例12: hiddenField

 function hiddenField($name, $type, $value)
 {
     $output = '';
     if ($name && $type) {
         $output = $this->html->input($type, array('type' => 'hidden', 'id' => low($name), 'value' => $value)) . '<br/>';
     }
     return $this->output($output);
 }
开发者ID:hikmanet,项目名称:HnsAutomobiles,代码行数:8,代码来源:d_auth.php

示例13: _getMainMenu

 function _getMainMenu()
 {
     $conditions = array('Group.name' => low($this->auth['User']['TYPE']));
     $this->loadModel('Group');
     $this->Group->Behaviors->attach('Containable');
     $this->Group->contain('Link.parent_id IS NULL');
     $group = $this->Group->find('first', array('conditions' => $conditions));
     return $group['Link'];
 }
开发者ID:javan-it-services,项目名称:steak,代码行数:9,代码来源:app_controller.php

示例14: _checkAccess

 function _checkAccess($aro, $aco)
 {
     $access = $this->Acl->check($aro, low($aco), $action = "*");
     if ($access === false) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:javan-it-services,项目名称:internal,代码行数:9,代码来源:acl_admin_app_controller.php

示例15: main

 function main()
 {
     $this->imagePath = WWW_ROOT . 'img' . DS . 'blog' . DS;
     $fileListContent = '';
     $posts = $this->Blogpost->find('all');
     foreach ($posts as $post) {
         //$this->Blogpost->id = $post['Blogpost']['id'];
         unset($post['Blogpost']['slug']);
         unset($post['Blogpost']['title']);
         unset($post['Blogpost']['user_id']);
         unset($post['Blogpost']['created']);
         unset($post['Blogpost']['deleted']);
         $subject = $post['Blogpost']['description'];
         preg_match_all('@<img[^>]*src="([^"]*)"[^>]*>@Usi', $subject, $matches);
         if (!empty($matches[1])) {
             foreach ($matches[1] as $img) {
                 $oldPath = $img;
                 $newPath = $this->imagePath . basename($img);
                 $wwwPath = '/img/blog/' . basename($img);
                 if (preg_match('/img/blog/', $img)) {
                     //that link already fixed
                     continue;
                 }
                 if (!preg_match('bpong.com', $img) && !preg_match('http://', $img)) {
                     //it's relative path. Let's deal with it separetely
                     if ($img[0] == '.') {
                         $img = $this->bpongPath . ltrim($img, '.');
                     } elseif ($img[0] == '/') {
                         $img = $this->bpongPath . $img;
                     } else {
                         $img = $this->bpongPath . '/' . $img;
                     }
                 }
                 if (!@copy($img, $newPath)) {
                     $errors = error_get_last();
                     $this->out("COPY ERROR: " . $errors['message']);
                     $this->out("FILE:" . $oldPath);
                     $key = $this->in('Change dp path anyway?', array('y', 'n', 'q'), 'y');
                     if (low($key) == 'y') {
                         $post['Blogpost']['description'] = str_replace($oldPath, $wwwPath, $post['Blogpost']['description']);
                         $fileListContent .= $oldPath . "\n\r";
                     } elseif (low($key) == 'q') {
                         exit;
                     }
                 } else {
                     $this->out($img . "\n\r COPY TO \n\r" . $newPath);
                     $post['Blogpost']['description'] = str_replace($oldPath, $wwwPath, $post['Blogpost']['description']);
                 }
             }
             $this->Blogpost->save($post);
         }
         //$this->out(pr($matches));
         //$this->Blogpost->save($post);
     }
     $this->createFile(WWW_ROOT . 'files.txt', $fileListContent);
 }
开发者ID:sgh1986915,项目名称:cakephp2-bpong,代码行数:56,代码来源:Imageload.php


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