本文整理匯總了PHP中Content::action方法的典型用法代碼示例。如果您正苦於以下問題:PHP Content::action方法的具體用法?PHP Content::action怎麽用?PHP Content::action使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Content
的用法示例。
在下文中一共展示了Content::action方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: action
/**
* 發表新任務
*/
public function action()
{
//列出用戶
$userList = \Model\Content::listContent('user');
$this->assign('user', $userList);
foreach ($userList as $key => $value) {
//獲取本部門的用戶
if ($value['user_department_id'] == $_SESSION['team']['user_department_id']) {
$localUser[$value['user_id']] = $value['user_name'];
}
//將所有用戶放到一個以用戶ID的一維數組,方便查找
$findUser[$value['user_id']] = $value['user_name'];
}
$this->assign('localUser', $localUser);
$this->assign('findUser', $findUser);
//列出部門
foreach (\Model\Content::listContent('department') as $key => $value) {
$department[$value['department_id']] = $value['department_name'];
}
$this->assign('department', $department);
//列出項目
$project = \Model\Content::listContent('project', array(), '', 'project_listsort ASC, project_id DESC');
$this->assign('project', $project);
parent::action();
}
示例2: action
/**
* 更新模型
*/
public function action($jump = FALSE, $commit = TRUE)
{
$model = \Model\ModelManage::findModel($_POST['id']);
parent::action($jump, $commit);
//更新菜單
$this->db('menu')->where('menu_name = :old_name')->update(array('menu_name' => $this->p('title'), 'noset' => array('old_name' => $model['model_title'])));
$this->success('更新模型成功', $this->url(GROUP . '-Model-index'));
}
示例3: action
public function action($jump = TRUE, $commit = TRUE)
{
if ($_POST['parent'] == '0') {
$_POST['value'] = (string) ucfirst(strtolower($_POST['value']));
} else {
$controller = \Model\Content::findContent('node', $_POST['parent'], 'node_id');
$_POST['check_value'] = GROUP . $_POST['method_type'] . $controller['node_value'] . $_POST['value'];
}
parent::action();
}
示例4: action
/**
* 部門添加/編輯
*/
public function action()
{
$userList = \Model\Content::listContent('user');
$this->assign('user', $userList);
foreach ($userList as $key => $value) {
$findUser[$value['user_id']] = $value['user_name'];
}
$this->assign('findUser', $findUser);
parent::action();
}
示例5: action
public function action($jump = FALSE, $commit = true)
{
\Model\Field::baseForm();
parent::action($jump, $commit);
if (empty($_GET['back_url'])) {
$url = $this->url(GROUP . '-Model-fieldList', array('id' => $this->p('id'), 'model_id' => \Model\Field::$model['model_id']));
} else {
$url = base64_decode($_GET['back_url']);
}
$this->success('更新字段成功', $url);
}
示例6: action
/**
* 添加內容
*/
public function action($jump = TRUE, $commit = TRUE)
{
if ($this->p('password')) {
$password = $this->p('password');
if ($password != $this->p('confirm_password')) {
$this->error('兩次輸入的密碼不一致');
}
$_POST['password'] = (string) \Core\Func\CoreFunc::generatePwd($this->isP('account', '請提交帳號') . $password, 'PRIVATE_KEY');
}
parent::action();
}
示例7: action
public function action()
{
$this->assign('topMenu', json_encode(\Model\Menu::topMenu()));
parent::action();
}