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


PHP arr::path方法代码示例

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


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

示例1: action_index

 public function action_index()
 {
     foreach ($this->_group_actions as $action => $cfg) {
         if (!ACL::is_action_allowed($this->request->directory(), $this->request->controller(), $action)) {
             unset($this->_group_actions[$action]);
         }
     }
     if (isset($_POST['group_actions'])) {
         $action = NULL;
         foreach (arr::get($_POST, 'action', array()) as $name => $value) {
             $action = $name;
         }
         $handler = arr::path($this->_group_actions, $action . '.handler');
         if ($action && $handler && method_exists($this, $handler)) {
             if (arr::path($this->_group_actions, $action . '.one_item')) {
                 foreach ($_POST['ids'] as $id) {
                     $item = ORM::factory($this->_model, $id);
                     if ($item->loaded()) {
                         $this->{$handler}($item);
                     }
                 }
             } else {
                 $ids = array();
                 foreach ($_POST['ids'] as $id) {
                     if ($id) {
                         $ids[] = $id;
                     }
                 }
                 if (count($ids)) {
                     $this->{$handler}($ids);
                 }
             }
         }
         $this->back($this->get_index_route());
     }
     $this->set_view('crud/index');
     Navigation::instance()->actions()->add($this->get_create_route(), 'Добавить');
     $model = ORM::factory($this->_model);
     $this->template->filter_form = $this->get_filter_form($model);
     if ($this->template->filter_form) {
         $this->template->filter_form->set_method('GET');
         if (isset($_GET['filter_cancel'])) {
             $this->redirect('/' . Extasy_Url::url_to_route($this->get_index_route()));
         }
         if (isset($_GET['filter'])) {
             $this->template->filter_form->submit();
         }
     }
     $this->template->unSortableFields = $model->getUnSortableSortableFields();
     $grid = $this->before_fetch($model)->grid()->set_group_actions($this->_group_actions);
     $this->template->grid = $this->prepare_grid($grid);
 }
开发者ID:ariol,项目名称:adminshop,代码行数:52,代码来源:Crud.php

示例2: array

						<input class="text-input medium-input" type="text" id="ff_first_name" name="first_name" value="<?php 
echo arr::get($user, 'first_name');
?>
" />
					</p>
					<p>
						<label for="ff_username">Username</label>
						<input class="text-input medium-input" type="text" id="ff_username" name="username" value="<?php 
echo arr::get($user, 'username');
?>
" />
					</p>
					<p>
						<label for="ff_role">Role</label>
						<?php 
echo form::select('role', $roles, arr::path($user, 'role.id'), array('class' => 'medium-input', 'id' => 'ff_role'));
?>
					</p>
				</fieldset>

				<fieldset class="column-right">
					<p>
						<label for="ff_last_name">Last Name</label>
						<input class="text-input medium-input" type="text" id="ff_last_name" name="last_name" value="<?php 
echo arr::get($user, 'last_name');
?>
" />
					</p>
					<p>
						<label for="ff_password">New Password</label>
						<input class="text-input medium-input" type="password" id="ff_password" name="password" value="<?php 
开发者ID:ngonchan,项目名称:Kooshy,代码行数:31,代码来源:admin-users-edit.php

示例3: foreach

        echo $errs;
    }
    echo '</label>';
}
?>
					</div>
					<div class="form-group">
						<label for="confirm-new-password">Confirm your new password</label>
						<input minlength="5" title="Must match above password" class="<?php 
echo $errors && arr::get($errors, 'password_confirm', false) ? 'error' : '';
?>
" type="password" placeholder="Re-enter your new password.." id="confirm-new-password" name="password_confirm">
<?php 
if ($errors && arr::path($errors, '_external.password_confirm', false)) {
    echo '<label for="confirm-new-password" class="error">';
    $errs = arr::path($errors, '_external.password_confirm');
    if (is_array($errs)) {
        echo '<ul>';
        foreach ($errs as $err) {
            echo '<li>' . $err . '</li>';
        }
        echo '</ul>';
    } else {
        echo $errs;
    }
    echo '</label>';
}
?>
					</div>
					
					<div class="form-group text-right">
开发者ID:artbypravesh,项目名称:morningpages,代码行数:31,代码来源:options.php

示例4: path

 /**
  * Gets a value from an array using a dot separated path.
  *
  *     // Get the value of $array['foo']['bar']
  *     $value = KMS::Session()->path($array, 'foo.bar');
  *
  * Using a wildcard "*" will search intermediate arrays and return an array.
  *
  *     // Get the values of "color" in theme
  *     $colors = KMS::Session()->path($array, 'theme.*.color');
  *
  *     // Using an array of keys
  *     $colors = KMS::Session()->path($array, array('theme', '*', 'color'));
  *
  * @param   mixed   key path string (delimiter separated) or array of keys
  * @param   mixed   default value if the path is not set
  * @return  type
  */
 public function path($path, $default = NULL)
 {
     return arr::path($this->_data, $path, $default);
 }
开发者ID:ngonchan,项目名称:Kooshy,代码行数:22,代码来源:session.php

示例5: array

?>
					</p>
					<div class="clear"></div>
					<p>
						<?php 
echo form::label('ff_password', 'Password');
?>
						<?php 
echo form::password('password', NULL, array('id' => 'ff_password', 'class' => 'text-input'));
?>
					</p>
					<div class="clear"></div>
					<!--
					<p id="remember-password">
						<?php 
echo form::checkbox('remember', 1, (bool) arr::path($ua, 'fields.remember', 1), array('id' => 'ff_remember'));
?>
						<?php 
echo form::label('ff_remember', 'Remember me');
?>
					</p>
					<div class="clear"></div>
					-->
					<p>
						<?php 
echo form::submit('login', 'Sign In', array('class' => 'button'));
?>
					</p>
				<?php 
echo form::close();
?>
开发者ID:ngonchan,项目名称:Kooshy,代码行数:31,代码来源:login.php

示例6: custom

 /**
  *
  * Returns custom type data by tagname.
  *
  * @param  string       $tag      tagname
  * @param  mixed        $default  default value if not exists
  * @return string|array
  */
 public static function custom($tag = NULL, $default = NULL)
 {
     if (is_null($tag)) {
         // returns all custom data
         if (!isset(self::$_data[message::CUSTOM])) {
             return $default;
         }
         $result = self::$_data[message::CUSTOM];
         // dont forget to clear data!
         self::remove(message::CUSTOM);
         return $result;
     }
     if (!isset(self::$_data[message::CUSTOM])) {
         return $default;
     }
     // check for existing
     if (isset(self::$_data[message::CUSTOM][$tag])) {
         // get tagged value and delete it from data
         $result = self::$_data[message::CUSTOM][$tag];
         self::remove(message::CUSTOM, $tag);
         return $result;
     } else {
         // check if there are dots in tag - its an array key
         if (strpos($tag, '.') === FALSE) {
             return $default;
         }
         return arr::path(self::$_data[message::CUSTOM], $tag, $default);
     }
 }
开发者ID:biakaveron,项目名称:message,代码行数:37,代码来源:message.php

示例7:

    echo arr::path($errors, '_external.password', '');
    echo '</span>';
}
?>
			</div>
			
			<div class="form-group<?php 
echo arr::path($errors, '_external.password_confirm', false) ? ' has-error' : '';
?>
">
				<label for="account-password-confirm">Confirm password:</label>
				<input type="password" placeholder="Confirm your new password" name="password_confirm" id="account-password-confirm" class="form-control" />
<?php 
if (arr::path($errors, '_external.password_confirm', false)) {
    echo '<span class="help-block">';
    echo arr::path($errors, '_external.password_confirm', '');
    echo '</span>';
}
?>
			</div>
			
			<button class="btn btn-primary">Save info</button>
			
		</form>
		
	</div>
	<div class="tab-pane" id="actions">
		<h4>Actions:</h4>
		<p>
			<a id="account-deleter" href="<?php 
echo user::url('delete');
开发者ID:artbypravesh,项目名称:morningpages,代码行数:31,代码来源:index.php


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