當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。