本文整理汇总了PHP中Prado::Using方法的典型用法代码示例。如果您正苦于以下问题:PHP Prado::Using方法的具体用法?PHP Prado::Using怎么用?PHP Prado::Using使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prado
的用法示例。
在下文中一共展示了Prado::Using方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRequestWithUrlMapping
public function testRequestWithUrlMapping()
{
Prado::Using('System.Web.TUrlMapping');
$confstr = '<config><url ServiceId="testService" ServiceParameter="testServiceParam" pattern="test/{param}/?" parameters.param="\\w+"/></config>';
$config = new TXmlDocument('1.0', 'utf8');
$config->loadFromString($confstr);
$module = new TUrlMapping();
self::$app->setModule('friendly-url', $module);
if (isset($_GET['page'])) {
unset($_GET['page']);
}
// Remove service from a previous test !
$_SERVER['REQUEST_URI'] = '/index.php/test/value2';
$_SERVER['SCRIPT_NAME'] = '/index.php';
$_SERVER['PHP_SELF'] = '/index.php/test/value2';
$_SERVER['QUERY_STRING'] = '';
$_SERVER['PATH_INFO'] = '/test/value2';
$request = new THttpRequest();
$request->setUrlManager('friendly-url');
$request->setUrlFormat(THttpRequestUrlFormat::Path);
$request->init(null);
$module->init($config);
self::assertEquals('testService', $request->resolveRequest(array('page', 'testService')));
}
示例2: matchCountries
<?php
Prado::Using('System.Web.UI.ActiveControls.*');
class Ticket719 extends TPage
{
protected function matchCountries($token)
{
$info = Prado::createComponent('System.I18N.core.CultureInfo', 'en');
$list = array();
$count = 0;
$token = strtolower($token);
foreach ($info->getCountries() as $country) {
if (strpos(strtolower($country), $token) === 0) {
$list[] = $country;
$count++;
if ($count > 10) {
break;
}
}
}
return $list;
}
function suggestion_selected($sender, $param)
{
var_dump($param->selectedIndex);
}
public function suggestCountries($sender, $param)
{
$sender->setDataSource($this->matchCountries($param->Token));
$sender->dataBind();
}