本文整理汇总了PHP中Application::setParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::setParam方法的具体用法?PHP Application::setParam怎么用?PHP Application::setParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::setParam方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: performHandlerTasks
public function performHandlerTasks()
{
$comment = new Comment();
$comment->clauseSafe('author_id', Logbook::current()->authorId());
$comment->clauseSafe('entry_id', Application::param('entry_id'));
$comment->clauseSafe('comment_id', Application::param('comment_id'));
$comment->delete();
Application::setParam('author_id', Logbook::current()->authorId());
$this->redirectOnSave();
}
示例2: editAboutMe
protected function editAboutMe()
{
$form = Form::load('logbook.views.EditBlogAuthorDetails');
if($form->validate())
{
$item = new Author();
$item->clause('user_id',Application::current()->user()->id());
$item->parse();
$item->synch();
Application::setParam('author_id',$item->id());
$this->redirectOnSave();
}
}
示例3: savePart
private function savePart()
{
$form = 'frost.views.cms.part.text.TextAdd';
$part = Part::addMediaToPart($form,'Text');
// Add the 'preview' to the part
$part = new Part();
$part->clauseSafe('part_id',Application::param('part_id'));
$part->parse();
$part->save();
//Part::setParttagsAndSave($part,Application::param('current_tags'));
Application::setParam('module_id',Application::param('module_id'));
Application::redirect('ModuleDetail');
}
示例4: save
public function save()
{
$form = Form::load('logbook.views.AddBlogComment');
$capval = Captcha::validate();
if($form->validate()&&$capval)
{
Application::alterParam('comment_content',strip_tags(Application::param('comment_content')));
$item = new Comment();
$item->parse();
$item->set('comment_date',date('Y-m-d H:M:S'));
$item->setSafe('author_id',Logbook::current()->authorId());
$item->save();
Application::setParam('author_id',Application::param('author_id'));
Application::setParam('entry_id',Application::param('entry_id'));
$this->redirectOnSave();
}
}
示例5: doEdit
protected function doEdit()
{
$form = $this->editForm();
if($form->validate())
{
$item = $this->entryToEdit();
$test = $item->restrict();
if(LogbookAccess::currentUserCanEdit($test))
{
$item = $this->entryToEdit();
$item->parse();
$item->synch();
Entry::setTagsAndSave($item,Application::param('entry_tags'));
Application::setParam('author_id',Application::param('author_id'));
Application::setParam('entry_id',Application::param('entry_id'));
}
LogbookAccess::publishLookupTables();
$this->redirectOnSave();
}
}
示例6: alterParam
/**
* Change a parameter that is in the $_POST, $_GET or user parameters array
*
* This method first checks post, then get, the user params to see if the value is present.
* If it was present in any of these, then it changes the value to the new one passed.
* If the value could not be found, then it is set using the {@link Application::setParam()}
* method
* @param name - the name of the value to change
* @param new_value - the new value
* @access public
* @static
*/
function alterParam($name, $new_value)
{
$ret = true;
if (!($param = Application::postVarsParam($name))) {
if (!($param = Application::getVarsParam($name))) {
Application::setParam($name, $new_value);
} else {
$_GET[$name] = $new_value;
}
} else {
$_POST[$name] = $new_value;
}
return $ret;
}
示例7: redirectOnAccessDenied
public function redirectOnAccessDenied()
{
Application::setParam('author_id', Logbook::current()->authorId());
Application::setParam('entry_id', Application::param('entry_id'));
Application::redirect(Application::defaultHandler());
}