本文整理汇总了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();
}