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


PHP Text::lower方法代码示例

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


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

示例1: resolve

 /**
  * {@inheritdoc}
  */
 public function resolve(&$value)
 {
     if (is_string($value) && strlen($value) > 0) {
         $value = \Phalcon\Text::lower($value);
     }
     return $value;
 }
开发者ID:arius86,项目名称:core,代码行数:10,代码来源:Lowercase.php

示例2: cast

 /**
  * Cast value to string
  * @param $value
  * @return string
  */
 public function cast($value)
 {
     if ($this->_trim === null && self::$_defaultTrim !== null) {
         $this->_trim = self::$_defaultTrim;
     }
     if (is_scalar($value)) {
         $value = (string) $value;
         if ($this->_trim === true) {
             $value = trim($value);
         }
         if ($this->_uppercase === true) {
             $value = \Phalcon\Text::upper($value);
         } elseif ($this->_lowercase === true) {
             $value = \Phalcon\Text::lower($value);
         }
         return $value;
     }
     return '';
 }
开发者ID:alexboo,项目名称:phalcon-annotation-mapper,代码行数:24,代码来源:StringCast.php

示例3: register

 /**
  * Initializes dispatcher
  */
 public function register()
 {
     $di = $this->getDi();
     $eventsManager = $this->getEventsManager();
     $config = $this->_config;
     $defaultModuleDir = $this->_module->getDefaultModuleDirectory();
     $di->set('defualtModuleDir', function () use($defaultModuleDir) {
         return $defaultModuleDir;
     });
     $moduleDirectory = $this->_module->getModuleDirectory();
     $di->set('moduleDirectory', function () use($moduleDirectory) {
         return $moduleDirectory;
     });
     $di->set('dispatcher', function () use($di, $eventsManager, $config) {
         // Create dispatcher
         $dispatcher = new MvcDispatcher();
         //Attach a listener
         $eventsManager->attach("dispatch:beforeException", function ($event, \Phalcon\Mvc\Dispatcher $dispatcher, $exception) use($di, $config) {
             if ($config->application->debug && $di->has('logger')) {
                 $logger = $di->get('logger');
                 $logger->error($exception->getMessage());
             }
             //Handle 404 exceptions
             if ($exception instanceof DispatchException) {
                 $dispatcher->forward(['controller' => 'error', 'action' => 'show404']);
                 return false;
             }
             if ($di->get('request')->isAjax() == true) {
             }
             //Handle other exceptions
             $dispatcher->forward(['controller' => 'error', 'action' => 'show503']);
             return false;
         });
         $eventsManager->attach("dispatch:beforeDispatchLoop", function ($event, \Phalcon\Mvc\Dispatcher $dispatcher) {
             $dispatcher->setControllerName(\Phalcon\Text::lower($dispatcher->getControllerName()));
         });
         $dispatcher->setEventsManager($eventsManager);
         return $dispatcher;
     });
 }
开发者ID:tashik,项目名称:phalcon_core,代码行数:43,代码来源:Dispatcher.php

示例4: function

    $url->setBaseUri("http://" . $_SERVER["SERVER_NAME"] . "/");
    return $url;
});
$di->set('router', function () {
    $router = new \Phalcon\Mvc\Router();
    $router->setDefaultModule("frontend");
    $router->add("/", array('module' => 'frontend', 'controller' => 'index', 'action' => 'index'));
    $router->add("/contactanos", array('module' => 'frontend', 'controller' => 'index', 'action' => 'contactanos'));
    $router->add("/token", array('module' => 'frontend', 'controller' => 'index', 'action' => 'token'));
    $router->notFound(array('module' => 'frontend', 'controller' => 'index', 'action' => 'show404'));
    /* Dashboard */
    $router->add("/dashboard", array('module' => 'dashboard', 'controller' => 'index', 'action' => 'index'));
    $router->add("/login", array('module' => 'dashboard', 'controller' => 'login', 'action' => 'index'));
    $router->add("/logout", array('module' => 'dashboard', 'controller' => 'login', 'action' => 'logout'));
    $router->add('/dashboard/([a-zA-Z\\-]+)/([a-zA-Z\\-]+)', array('module' => 'dashboard', 'controller' => 1, 'action' => 2))->setName("controllers")->convert('action', function ($action) {
        return \Phalcon\Text::lower(\Phalcon\Text::camelize($action));
    });
    $router->removeExtraSlashes(true);
    return $router;
});
/**
 * Start the session the first time some component request the session service
 */
$di->set('dispatcher', function () use($di) {
    $dispatcher = new \Phalcon\Mvc\Dispatcher();
    $eventsManager = $di->getShared('eventsManager');
    $security = new Security($di);
    $eventsManager->attach('dispatch', $security);
    $dispatcher->setEventsManager($eventsManager);
    return $dispatcher;
});
开发者ID:EdgarSM91,项目名称:phalcon-angular,代码行数:31,代码来源:index.php

示例5: lower

 public static function lower($str)
 {
     return parent::lower($str);
 }
开发者ID:lisong,项目名称:cphalcon,代码行数:4,代码来源:Text.php

示例6: lower

 public static function lower($str, $encoding = "UTF-8")
 {
     return parent::lower($str, $encoding);
 }
开发者ID:mattvb91,项目名称:cphalcon,代码行数:4,代码来源:Text.php

示例7: testLower

 public function testLower()
 {
     $this->assertEquals(PhText::lower('hello'), 'hello');
     $this->assertEquals(PhText::lower('HELLO'), 'hello');
     $this->assertEquals(PhText::lower('1234'), '1234');
 }
开发者ID:lisong,项目名称:cphalcon,代码行数:6,代码来源:UnitTest.php

示例8: testLowerException

 public function testLowerException()
 {
     $this->setExpectedException('\\Phalcon\\Exception');
     \Phalcon\Text::lower(13.43);
 }
开发者ID:aisuhua,项目名称:phalcon-php,代码行数:5,代码来源:TextTest.php


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