本文整理匯總了PHP中Backend\Core\Engine\Model::getURLForBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model::getURLForBlock方法的具體用法?PHP Model::getURLForBlock怎麽用?PHP Model::getURLForBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Backend\Core\Engine\Model
的用法示例。
在下文中一共展示了Model::getURLForBlock方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addProductData
/**
* Add productdata into the comment
*
* @param string $text The comment.
* @param string $title The title for the product.
* @param string $URL The URL for the product.
* @param int $id The id of the comment.
* @return string
*/
public static function addProductData($text, $title, $URL, $id)
{
// reset URL
$URL = BackendModel::getURLForBlock('Catalog', 'Detail') . '/' . $URL . '#comment-' . $id;
// build HTML
return '<p><em>' . sprintf(BL::msg('CommentOnWithURL'), $URL, $title) . '</em></p>' . "\n" . (string) $text;
}
示例2: parse
/**
* Parse the form
*/
protected function parse()
{
parent::parse();
// parse additional variables
$this->tpl->assign('commentsRSSURL', SITE_URL . BackendModel::getURLForBlock($this->URL->getModule(), 'comments_rss'));
$this->tpl->assign('isGod', $this->isGod);
}
示例3: execute
public function execute()
{
parent::execute();
try {
$id = Uuid::fromString($this->getParameter('id', 'string'));
$teamMember = $this->get('team_repository')->find($id);
} catch (\Exception $e) {
return $this->redirect(Model::createURLForAction('Index') . '&error=non-existing');
}
$form = new TeamType('edit', $teamMember);
if ($form->handle()) {
$teamMember = $form->getData();
$this->get('team_repository')->save($teamMember);
return $this->redirect(Model::createURLForAction('Index') . '&report=edited' . '&highlight=row-' . $teamMember->getId());
}
// assign the detail url to the template if available
$url = Model::getURLForBlock($this->URL->getModule(), 'Detail');
if (Model::getURL(404) != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
$form->parse($this->tpl);
$this->tpl->assign('teamMember', $teamMember->toArray());
$this->parse();
$this->display();
}
示例4: parse
public function parse()
{
parent::parse();
$url = BackendModel::getURLForBlock($this->URL->getModule(), 'Category');
$url404 = BackendModel::getURL(404);
if ($url404 != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
}
示例5: parse
/**
* Parse the page
*/
protected function parse()
{
parent::parse();
// assign the url for the detail page
$url = BackendModel::getURLForBlock($this->URL->getModule(), 'Group');
$url404 = BackendModel::getURL(404);
if ($url404 != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
}
示例6: loadForm
/**
* Load the form
*/
private function loadForm()
{
// create form
$this->frm = new BackendForm('editSubscription');
// create elements
$this->frm->addText('name', $this->record['name']);
$this->frm->addText('email', $this->record['email']);
// assign URL
$this->tpl->assign('itemURL', BackendModel::getURLForBlock($this->getModule(), 'detail') . '/' . $this->record['agenda_url'] . '#subscription-' . $this->record['agenda_id']);
$this->tpl->assign('itemTitle', $this->record['agenda_title']);
}
示例7: parse
/**
* Parse the form
*/
protected function parse()
{
parent::parse();
// assign the data
$this->tpl->assign('item', $this->record);
$this->tpl->assign('showFaqDeleteCategory', BackendFaqModel::deleteCategoryAllowed($this->id) && BackendAuthentication::isAllowedAction('DeleteCategory'));
$url = BackendModel::getURLForBlock($this->URL->getModule(), 'Category');
$url404 = BackendModel::getURL(404);
if ($url404 != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
}
示例8: parse
/**
* Parse the page
*/
protected function parse()
{
parent::parse();
// Get url
$url = Model::getURLForBlock($this->URL->getModule(), 'Detail');
$url404 = Model::getURL(404);
// Parse additional variables
if ($url404 != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
$this->tpl->assign('item', $this->record);
}
示例9: parse
/**
* Parse the page
*/
protected function parse()
{
parent::parse();
$this->tpl->assign('item', $this->record);
$this->tpl->assign('iframe', BackendModel::createURLForAction('preview') . "&id=" . $this->id);
// get url
$url = BackendModel::getURLForBlock($this->URL->getModule(), 'detail');
$url404 = BackendModel::getURL(404);
if ($url404 != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
}
示例10: parse
/**
* Parse the form
*/
protected function parse()
{
parent::parse();
// get url
$url = BackendModel::getURLForBlock($this->URL->getModule(), 'detail');
$url404 = BackendModel::getURL(404);
if ($url404 != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
// assign the active record and additional variables
$this->tpl->assign('item', $this->record);
$this->tpl->assign('feedback', $this->feedback);
}
示例11: loadForm
/**
* Load the form
*/
private function loadForm()
{
// create form
$this->frm = new BackendForm('editComment');
// create elements
$this->frm->addText('author', $this->record['author']);
$this->frm->addText('email', $this->record['email']);
$this->frm->addText('website', $this->record['website'], null);
$this->frm->addTextarea('text', $this->record['text']);
// assign URL
$this->tpl->assign('itemURL', BackendModel::getURLForBlock($this->getModule(), 'detail') . '/' . $this->record['post_url'] . '#comment-' . $this->record['post_id']);
$this->tpl->assign('itemTitle', $this->record['post_title']);
}
示例12: execute
public function execute()
{
parent::execute();
$form = new TeamType('add');
if ($form->handle()) {
$teamMember = $form->getData();
$this->get('team_repository')->add($teamMember);
return $this->redirect(Model::createURLForAction('Index') . '&report=added' . '&highlight=row-' . $teamMember->getId());
}
// assign the detail url to the template if available
$url = Model::getURLForBlock($this->URL->getModule(), 'Detail');
if (Model::getURL(404) != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
$form->parse($this->tpl);
$this->parse();
$this->display();
}
示例13: updateGroup
/**
* Updates a list with campaignmonitor and in the database. Returns the affected rows
*
* @param array $item The new data.
* @return int
*/
public static function updateGroup($item)
{
// build unsubscribe link for this list
$unsubscribeLink = SITE_URL . BackendModel::getURLForBlock('Mailmotor', 'unsubscribe', BL::getWorkingLanguage());
// update the group with CM
self::getCM()->updateList($item['name'], $unsubscribeLink . '/?group=' . $item['id'] . '&email=[email]', null, null, self::getCampaignMonitorID('list', $item['id']));
// check if we have a default group set
if ($item['is_default'] === 'Y' && $item['language'] != '0') {
// set all defaults to N
BackendModel::getContainer()->get('database')->update('mailmotor_groups', array('is_default' => 'N', 'language' => null), 'language = ?', array($item['language']));
}
// update the group in our database
return (int) BackendMailmotorModel::updateGroup($item);
}
示例14: parse
/**
* Parse the form
*
* @return void
*/
protected function parse()
{
//--Add javascript file
$this->header->addJS('Jquery.uploadify.min.js', null, false);
$this->header->addJS('Edit.js', null, false);
$this->header->addCSS('Uploadify.css');
// call parent
parent::parse();
// assign the category
$this->tpl->assign('album', $this->record);
$this->tpl->assign('images', $this->images);
if ($this->frmAddImage) {
$this->frmAddImage->parse($this->tpl);
}
if ($this->frmDeleteImage) {
$this->frmDeleteImage->parse($this->tpl);
}
//--Add data to Javascript
$this->header->addJsData("Galleria", "id", $this->id);
// can the category be deleted?
if (BackendGalleriaModel::deleteAlbumAllowed($this->id)) {
$this->tpl->assign('showDelete', true);
}
// get url
$url = BackendModel::getURLForBlock($this->URL->getModule(), 'group');
$url404 = BackendModel::getURL(404);
if ($url404 != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
}
示例15: getMailingPreviewURL
/**
* Get a preview URL to the specific mailing
*
* @param int $id The id of the mailing.
* @param string $contentType The content-type, possible values are: html, plain.
* @param bool $forCM Is the URL intended for Campaign Monitor.
* @return string
*/
public static function getMailingPreviewURL($id, $contentType = 'html', $forCM = false)
{
$contentType = \SpoonFilter::getValue($contentType, array('html', 'plain'), 'html');
$forCM = \SpoonFilter::getValue($forCM, array(false, true), false, 'int');
// return the URL
return SITE_URL . BackendModel::getURLForBlock('Mailmotor', 'Detail') . '/' . $id . '?type=' . $contentType . '&cm=' . $forCM;
}