本文整理匯總了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']) {