本文整理汇总了PHP中ProjectModule::addProjectModule方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectModule::addProjectModule方法的具体用法?PHP ProjectModule::addProjectModule怎么用?PHP ProjectModule::addProjectModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectModule
的用法示例。
在下文中一共展示了ProjectModule::addProjectModule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialchars
}
$project->id = $data['id'];
$project->u_id = $_SESSION['user_info']['id'];
$project->m_id = $data['m_id'];
$project->name = htmlspecialchars($data['name'], ENT_QUOTES);
$project->discribe = htmlspecialchars($data['discribe'], ENT_QUOTES);
//生成tciket
$project->ticket = substr(md5(uniqid() + (string) rand()), -8);
$project->exp_url = dirname($_SERVER["HTTP_REFERER"]) . "/" . "rat.php?t=" . $project->ticket;
$projectModule->project_id = $project->addProject();
$projectModule->module_id = $data['m_id'];
$projectModule->module_path = $module->m_path;
$projectModule->ticket = $project->ticket;
$projectModule->config = json_encode($data['config']);
if ($projectModule->project_id) {
if ($projectModule->addProjectModule()) {
$res['result'] = true;
$res['reason'] = 'Add Project Success!';
} else {
$res['reason'] = 'Add Project Module Failed!';
}
} else {
$res['reason'] = 'Add Project Failed!';
}
}
if ($data['op'] === 'edit') {
//validate power
//judge the editor id and the project uid
//judge if the project u_id is eq user id
if ($project->getProjectById((int) $data['id'])) {
if ($project->u_id !== $_SESSION['user_info']['id']) {