本文整理汇总了PHP中Zend_Filter_Word_SeparatorToSeparator类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Filter_Word_SeparatorToSeparator类的具体用法?PHP Zend_Filter_Word_SeparatorToSeparator怎么用?PHP Zend_Filter_Word_SeparatorToSeparator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Filter_Word_SeparatorToSeparator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __set
/**
* Overload: set property
*
* @param string $name
* @param mixed $value
* @return void
*/
public function __set($name, $value)
{
if (!in_array($name, $this->_allowed)) {
throw new FFR_Model_Exception(sprintf('Invalid parameter "%s" specified', $name));
}
$inputFilter = $this->getForm('CreateFormField');
$element = $inputFilter->getElement($name);
if ($element) {
if ($name == 'form_field_id') {
$element->removeValidator('DB_NoRecordExists');
}
if (!$element->isValid($value)) {
throw new FFR_Model_Exception(sprintf('Invalid value specified for %s: %s', $name, $value));
}
$value = $element->getValue();
}
if ($name == 'form_field_attribs' || $name == 'form_field_options') {
if (is_string($value)) {
$this->_data[$name] = unserialize($value);
} else {
$this->_data[$name] = $value;
}
} else {
$this->_data[$name] = $value;
}
if ($name == 'form_field_attribs') {
// Store the field name
$filter = new Zend_Filter_Word_SeparatorToSeparator(' ', '_');
$name = $filter->filter(strtolower(preg_replace('/[^A-Za-z0-9 ]/', '', $this->_data[$name]['Label'])));
$this->_data['form_field_name'] = $name;
}
}
开发者ID:rantoine,项目名称:AdvisorIllustrator,代码行数:39,代码来源:FormField.php
示例2: testFilterSeparatesWordsWithSearchAndReplacementSpecified
public function testFilterSeparatesWordsWithSearchAndReplacementSpecified()
{
$string = 'dash=separated=words';
$filter = new Zend_Filter_Word_SeparatorToSeparator('=', '?');
$filtered = $filter->filter($string);
$this->assertNotEquals($string, $filtered);
$this->assertEquals('dash?separated?words', $filtered);
}
开发者ID:netvlies,项目名称:zf,代码行数:8,代码来源:SeparatorToSeparatorTest.php
示例3: getResourceId
/**
* Returns the resource ID for the model in the form model:name
*
* @return string
*/
public function getResourceId()
{
$filter = new Zend_Filter_Word_SeparatorToSeparator('_', '.');
$className = strtolower($this->getClassType($this));
$resourceId = 'model:' . $filter->filter(str_replace('model_', '', $className));
return $resourceId;
}
开发者ID:rodp82,项目名称:ZF1-Skeleton,代码行数:12,代码来源:Entity.php
示例4: __construct
/**
* Constructor
*
* @param string $separator Space by default
* @return void
*/
public function __construct()
{
parent::__construct('-', '_');
}
开发者ID:7thZoneTechnology,项目名称:hrms-1,代码行数:10,代码来源:DashToUnderscore.php
示例5: __construct
/**
* Constructor
*
* @param string $separator Space by default
* @return void
*/
public function __construct($replacementSeparator = ' ')
{
parent::__construct('_', $replacementSeparator);
}
开发者ID:fredcido,项目名称:simuweb,代码行数:10,代码来源:UnderscoreToSeparator.php
示例6: __construct
/**
* Constructor
*
* @param string $searchSeparator Seperator to search for change
* @return void
*/
public function __construct($searchSeparator = ' ')
{
parent::__construct($searchSeparator, '-');
}
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:10,代码来源:SeparatorToDash.php
示例7:
function __construct()
{
parent::__construct(':', '/');
}
开发者ID:pago,项目名称:pantr,代码行数:4,代码来源:ColonToSlash.php
注:本文中的Zend_Filter_Word_SeparatorToSeparator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论