本文整理汇总了PHP中Zend_Filter_Alpha类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Filter_Alpha类的具体用法?PHP Zend_Filter_Alpha怎么用?PHP Zend_Filter_Alpha使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Filter_Alpha类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: eliminarAction
function eliminarAction()
{
$this->view->subtitle = "Eliminar ítem del Menú de la Página";
$menupag = new PaginasMenu();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_Alpha');
$filter = new Zend_Filter_Alpha();
$id = (int) $this->_request->getPost('id');
$id_menu = (int) $this->_request->getPost('menu');
$del = $filter->filter($this->_request->getPost('del'));
if ($del == 'Si' && $id) {
$where = 'id_pagina = ' . $id . ' AND id_menu= ' . $id_menu;
$rows_affected = $menupag->delete($where);
}
} else {
$id = (int) $this->_request->getParam('pagina');
$id_menu = (int) $this->_request->getParam('menu');
if ($id) {
$this->view->menupag = $menupag->fetchRow('id_pagina=' . $id . ' AND id_menu = ' . $id_menu);
if ($this->view->menupag->id_menu) {
$this->render();
return;
}
}
}
$this->_redirect(self::RETORNO . $id);
}
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:27,代码来源:MenupagController.php
示例2: eliminarAction
public function eliminarAction()
{
$this->view->subtitle = $this->info->sitio->menu->eliminar->titulo;
$item = new Menu();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_Alpha');
$filter = new Zend_Filter_Alpha();
$id = (int) $this->_request->getPost('id');
$del = $filter->filter($this->_request->getPost('del'));
if ($del == 'Si' && $id > 0) {
$where = 'id = ' . $id;
$rows_affected = $item->delete($where);
}
} else {
$id = (int) $this->_request->getParam('id');
if ($id > 0) {
$this->view->item = $item->fetchRow('id=' . $id);
if ($this->view->item->id > 0) {
$this->render();
return;
}
}
}
$this->_redirect('/admin/menu/');
}
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:25,代码来源:MenuController.php
示例3: deleteAction
function deleteAction()
{
$this->view->title = "Delete user";
$user = new Application_Model_User();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_Alpha');
$filter = new Zend_Filter_Alpha();
$id = (int) $this->_request->getPost('id');
$del = $filter->filter($this->_request->getPost('del'));
if ($del == 'Yes' && $id > 0) {
$where = 'id = ' . $id;
$rows_affected = $user->delete($where);
}
} else {
$id = (int) $this->_request->getParam('id');
if ($id > 0) {
// only render if we have an id and can find the vehicle.
$this->view->user = $user->fetchRow('id=' . $id);
if ($this->view->user->id > 0) {
// render template automatically
return;
}
}
}
// redirect back to the vehicle list unless we have rendered the view
$this->_redirect('/users');
}
开发者ID:spitfire471,项目名称:zend,代码行数:27,代码来源:UsersController.php
示例4: somenteletraAction
public function somenteletraAction()
{
$v = new Zend_Filter_Alpha(array('allowwhitespace' => true));
$texto = 'Thais,*123* Renan *456* @ Mayara';
echo $v->filter($texto);
exit;
}
开发者ID:JoaoAntonioMaruti,项目名称:AulasUnipar2015,代码行数:7,代码来源:FiltroController.php
示例5: cargaExcel
public function cargaExcel()
{
$filtro = new Zend_Filter_Alpha();
$this->load->library("excel");
$excel = $this->excel->leerExcel(BASEPATH . "../media/embarazos.xlsx");
$columnas = array();
$worksheet = $excel->setActiveSheetIndex(0);
$primera = true;
foreach ($worksheet->getRowIterator() as $row) {
if (!$primera) {
$cellIterator = $row->getCellIterator();
$cellIterator->setIterateOnlyExistingCells(true);
// Loop all cells, even if it is not set
$apellido_paterno = "";
$apellido_materno = "";
$propiedades = array();
$FPP = "";
$FUR = "";
foreach ($cellIterator as $cell) {
if (!is_null($cell) and $cell->getCalculatedValue() != "") {
if ($filtro->filter(trim(substr($cell->getCoordinate(), 0, 2))) == "A") {
$propiedades["RUN"] = $cell->getCalculatedValue();
}
if ($filtro->filter(trim(substr($cell->getCoordinate(), 0, 2))) == "B") {
$apellido_paterno = $cell->getCalculatedValue();
}
if ($filtro->filter(trim(substr($cell->getCoordinate(), 0, 2))) == "C") {
$apellido_materno = $cell->getCalculatedValue();
}
if ($filtro->filter(trim(substr($cell->getCoordinate(), 0, 2))) == "D") {
$propiedades["NOMBRE"] = $cell->getCalculatedValue();
}
if ($filtro->filter(trim(substr($cell->getCoordinate(), 0, 2))) == "E") {
$propiedades["EDAD"] = $cell->getCalculatedValue();
}
if ($filtro->filter(trim(substr($cell->getCoordinate(), 0, 2))) == "F") {
if (PHPExcel_Shared_Date::isDateTime($cell)) {
$fecha = date("Y-m-d", PHPExcel_Shared_Date::ExcelToPHP($cell->getValue()));
$FPP = $fecha;
}
}
if ($filtro->filter(trim(substr($cell->getCoordinate(), 0, 2))) == "G") {
if (PHPExcel_Shared_Date::isDateTime($cell)) {
$fecha = date("Y-m-d", PHPExcel_Shared_Date::ExcelToPHP($cell->getValue()));
$FUR = $fecha;
}
}
}
}
$propiedades["APELLIDO"] = $apellido_paterno . " " . $apellido_materno;
$this->_intoxicacion_model->insert(array("fecha" => DATE("Y-m-d"), "propiedades" => json_encode($propiedades), "FUR" => $FUR, "id_usuario" => 1, "FPP" => $FPP));
}
$primera = false;
}
// print_r($columnas);
}
开发者ID:CarlosAyala,项目名称:midas-codeigniter-modulo-emergencias,代码行数:56,代码来源:intoxicacion.php
示例6: isValid
/**
* Defined by Zend_Validate_Interface
*
* Returns true if and only if $value contains only alphabetic characters
*
* @param string $value
* @return boolean
*/
public function isValid($value)
{
if (!is_string($value)) {
$this->_error(self::INVALID);
return false;
}
$this->_setValue($value);
if ('' === $value) {
$this->_error(self::STRING_EMPTY);
return false;
}
if (null === self::$_filter) {
/**
* @see Zend_Filter_Alpha
*/
require_once 'Zend/Filter/Alpha.php';
self::$_filter = new Zend_Filter_Alpha();
}
self::$_filter->allowWhiteSpace = $this->allowWhiteSpace;
if ($value !== self::$_filter->filter($value)) {
$this->_error(self::NOT_ALPHA);
return false;
}
return true;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:33,代码来源:Alpha.php
示例7: isValid
/**
* Defined by Zend_Validate_Interface
*
* Returns true if and only if $value contains only alphabetic characters
*
* @param string $value
* @return boolean
*/
public function isValid($value)
{
$valueString = (string) $value;
$this->_setValue($valueString);
if ('' === $valueString) {
$this->_error(self::STRING_EMPTY);
return false;
}
if (null === self::$_filter) {
/**
* @see Zend_Filter_Alpha
*/
require_once 'Zend/Filter/Alpha.php';
self::$_filter = new Zend_Filter_Alpha();
}
if ($valueString !== self::$_filter->filter($valueString)) {
$this->_error(self::NOT_ALPHA);
return false;
}
return true;
}
开发者ID:jorgenils,项目名称:zend-framework,代码行数:29,代码来源:Alpha.php
示例8: getAlpha
/**
* Returns only the alphabetic characters in value.
*
* @deprecated since 0.8.0
* @param mixed $value
* @return string
*/
public static function getAlpha($value)
{
require_once 'Zend/Filter/Alpha.php';
$filter = new Zend_Filter_Alpha();
return $filter->filter($value);
}
开发者ID:jorgenils,项目名称:zend-framework,代码行数:13,代码来源:Filter.php
示例9: supprimeravatarAction
function supprimeravatarAction()
{
$this->view->title = "Suppression de l'avatar";
$avatar = new Avatar();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_Alpha');
$filter = new Zend_Filter_Alpha();
$id = (int) $this->_request->getPost('id');
$del = $filter->filter($this->_request->getPost('del'));
if ($del == 'Oui' && $id > 0) {
$where = $avatar->getAdapter()->quoteInto('id_avatar =?', $id);
$rows_affected = $avatar->delete($where);
$fichier = $_SERVER['DOCUMENT_ROOT'] . '/Magic_TA/public/images/avatar/' . $id . ".png";
unlink($fichier);
}
$this->_redirect('avatar/avatar');
} else {
$id = (int) $this->_request->getParam('id');
$this->user = Zend_Auth::getInstance()->getIdentity();
if (avatarViolation($id, $this->user->id_utilisateur)) {
$this->_redirect('avatar/avatar');
return;
}
if ($id > 0) {
$this->view->avatar = $avatar->fetchRow('id_avatar=' . $id);
if ($this->view->avatar->id_avatar > 0) {
return;
} else {
$this->_redirect('avatar/avatar');
}
}
}
}
开发者ID:Zabu,项目名称:MTA,代码行数:33,代码来源:AvatarController.php
示例10: eliminarAction
function eliminarAction()
{
//$info = Zend_Registry::get('personalizacion');
if (!$this->view->usuarioLogueado) {
die($this->info->sitio->noticias->eliminar->msgRestringido);
}
$this->view->subtitle = $this->info->sitio->noticias->eliminar->titulo;
$noticia = new Noticias();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_Alpha');
$filter = new Zend_Filter_Alpha();
$id = (int) $this->_request->getPost('id');
$del = $filter->filter($this->_request->getPost('del'));
if ($del == 'Si' && $id > 0) {
$where = 'id = ' . $id;
$rows_affected = $noticia->delete($where);
}
} else {
$id = (int) $this->_request->getParam('id');
if ($id > 0) {
$this->view->noticia = $noticia->fetchRow('id=' . $id);
if ($this->view->noticia->id > 0) {
$this->render();
return;
}
}
}
$this->_redirect('/admin/noticias/');
}
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:29,代码来源:NoticiasController.php
示例11: zamowieniadeleteAction
function zamowieniadeleteAction()
{
$this->view->title = "Delete Zamowienia";
$zamowienia = new Zamowienia();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_Alpha');
$filter = new Zend_Filter_Alpha();
$idzamowienia = (int) $this->_request->getPost('idzamowienia');
$del = $filter->filter($this->_request->getPost('del'));
if ($del == 'Yes' && $idzamowienia > 0) {
$where = 'idzamowienia = ' . $idzamowienia;
$rows_affected = $zamowienia->delete($where);
}
} else {
$idzamowienia = (int) $this->_request->getParam('idzamowienia');
if ($idzamowienia > 0) {
// only render if we have an id and can find the pages.
$this->view->zamowienia = $zamowienia->fetchRow('idzamowienia=' . $idzamowienia);
if ($this->view->zamowienia->idzamowienia > 0) {
// render template automatically
return;
}
}
}
// redirect back to the pages list unless we have rendered the view
$this->_redirect('/admin/zamowienia/');
}
开发者ID:stasiu38,项目名称:cms,代码行数:27,代码来源:AdminController.php
示例12: eliminarAction
public function eliminarAction()
{
$this->view->subtitle = "Eliminar";
$archivos = new Archivos();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_Alpha');
$filter = new Zend_Filter_Alpha();
$id = (int) $this->_request->getPost('id');
$del = $filter->filter($this->_request->getPost('del'));
if ($del == 'Si' && $id > 0) {
$pa = new PaginasArchivos();
$rows_affected = $pa->delete('id_archivo =' . $id);
$where = 'id = ' . $id;
$rows_affected = $archivos->delete($where);
}
} else {
$id = (int) $this->_request->getParam('id');
if ($id > 0) {
$this->view->archivo = $archivos->fetchRow('id=' . $id);
if ($this->view->archivo->id > 0) {
$this->render();
return;
}
}
}
$this->_redirect('/admin/archivos/');
}
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:27,代码来源:ArchivosController.php
示例13: alpha
/**
* filters the value as alpha
*
* @param string $key
* @return string
*/
public static function alpha($key)
{
$filter = new Zend_Filter_Alpha();
$post = self::toObject();
return trim($filter->filter($post->{$key}));
}
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:12,代码来源:Post.php
示例14: testBasic
/**
* Ensures that the filter follows expected behavior
*
* @return void
*/
public function testBasic()
{
$valuesExpected = array('abc123' => 'abc', 'abc 123' => 'abc', 'abcxyz' => 'abcxyz', 'četně' => 'četně', 'لعربية' => 'لعربية', 'grzegżółka' => 'grzegżółka', 'België' => 'België', '' => '');
foreach ($valuesExpected as $input => $output) {
$this->assertEquals($output, $result = $this->_filter->filter($input), "Expected '{$input}' to filter to '{$output}', but received '{$result}' instead");
}
}
开发者ID:jorgenils,项目名称:zend-framework,代码行数:12,代码来源:AlphaTest.php
示例15: testBasic
/**
* Ensures that the filter follows expected behavior
*
* @return void
*/
public function testBasic()
{
$valuesExpected = array('abc123' => 'abc', 'abc 123' => 'abc', 'abcxyz' => 'abcxyz', 'AZ@#4.3' => 'AZ');
foreach ($valuesExpected as $input => $output) {
$this->assertEquals($output, $this->_filter->filter($input));
}
}
开发者ID:jorgenils,项目名称:zend-framework,代码行数:12,代码来源:AlphaTest.php
示例16: __construct
/**
* Sets default option values for this instance
*
* @param boolean $allowWhiteSpace
* @return void
*/
public function __construct($allowWhiteSpace = false)
{
$this->allowWhiteSpace = (bool) $allowWhiteSpace;
if (null === self::$_unicodeEnabled) {
self::$_unicodeEnabled = @preg_match('/\\pL/u', 'a') ? true : false;
}
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:13,代码来源:Alpha.php
示例17: __construct
/**
* Sets default option values for this instance
*
* @param boolean $allowWhiteSpace
* @return void
*/
public function __construct($allowWhiteSpace = false)
{
$this->allowWhiteSpace = (bool) $allowWhiteSpace;
if (null === self::$_unicodeEnabled) {
self::$_unicodeEnabled = @preg_match('/\\pL/u', 'a') ? true : false;
}
if (null === self::$_meansEnglishAlphabet) {
$this->_locale = new Zend_Locale(Zend_Locale::BROWSER);
self::$_meansEnglishAlphabet = in_array($this->_locale->getLanguage(), array('ja'));
}
}
开发者ID:lortnus,项目名称:zf1,代码行数:17,代码来源:Alpha.php
示例18: testAllowWhiteSpace
/**
* Ensures that the filter follows expected behavior
*
* @return void
*/
public function testAllowWhiteSpace()
{
$this->_filter->allowWhiteSpace = true;
if (!self::$_unicodeEnabled) {
// Sorry folks, no unicode tests for you
$valuesExpected = array('abc123' => 'abc', 'abc 123' => 'abc ', 'abcxyz' => 'abcxyz', '' => '', "\n" => "\n", " \t " => " \t ");
} else {
$valuesExpected = array('abc123' => 'abc', 'abc 123' => 'abc ', 'abcxyz' => 'abcxyz', 'četně' => 'četně', 'لعربية' => 'لعربية', 'grzegżółka' => 'grzegżółka', 'België' => 'België', '' => '', "\n" => "\n", " \t " => " \t ");
}
foreach ($valuesExpected as $input => $output) {
$this->assertEquals($output, $result = $this->_filter->filter($input), "Expected '{$input}' to filter to '{$output}', but received '{$result}' instead");
}
}
开发者ID:jorgenils,项目名称:zend-framework,代码行数:18,代码来源:AlphaTest.php
示例19: testAllowWhiteSpace
/**
* Ensures that the filter follows expected behavior
*
* @return void
*/
public function testAllowWhiteSpace()
{
$this->_filter->setAllowWhiteSpace(true);
if (!self::$_unicodeEnabled) {
// POSIX named classes are not supported, use alternative a-zA-Z match
$valuesExpected = array('abc123' => 'abc', 'abc 123' => 'abc ', 'abcxyz' => 'abcxyz', '' => '', "\n" => "\n", " \t " => " \t ");
}
if (self::$_meansEnglishAlphabet) {
//The Alphabet means english alphabet.
$valuesExpected = array('a B' => 'a B', 'zY x' => 'zx');
} else {
//The Alphabet means each language's alphabet.
$valuesExpected = array('abc123' => 'abc', 'abc 123' => 'abc ', 'abcxyz' => 'abcxyz', 'četně' => 'četně', 'لعربية' => 'لعربية', 'grzegżółka' => 'grzegżółka', 'België' => 'België', '' => '', "\n" => "\n", " \t " => " \t ");
}
foreach ($valuesExpected as $input => $output) {
$this->assertEquals($output, $result = $this->_filter->filter($input), "Expected '{$input}' to filter to '{$output}', but received '{$result}' instead");
}
}
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:23,代码来源:AlphaTest.php
示例20: __construct
/**
* Sets default option values for this instance
*
* @param boolean $allowWhiteSpace
* @return void
*/
public function __construct($allowWhiteSpace = false)
{
if ($allowWhiteSpace instanceof Zend_Config) {
$allowWhiteSpace = $allowWhiteSpace->toArray();
} elseif (is_array($allowWhiteSpace)) {
if (array_key_exists('allowwhitespace', $allowWhiteSpace)) {
$allowWhiteSpace = $allowWhiteSpace['allowwhitespace'];
} else {
$allowWhiteSpace = false;
}
}
$this->allowWhiteSpace = (bool) $allowWhiteSpace;
if (null === self::$_unicodeEnabled) {
self::$_unicodeEnabled = @preg_match('/\\pL/u', 'a') ? true : false;
}
if (null === self::$_meansEnglishAlphabet) {
$this->_locale = new Zend_Locale('auto');
self::$_meansEnglishAlphabet = in_array($this->_locale->getLanguage(), array('ja', 'ko', 'zh'));
}
}
开发者ID:Cryde,项目名称:sydney-core,代码行数:26,代码来源:Alpha.php
注:本文中的Zend_Filter_Alpha类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论