本文整理匯總了PHP中Sintattica\Atk\Core\Tools::useattrib方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tools::useattrib方法的具體用法?PHP Tools::useattrib怎麽用?PHP Tools::useattrib使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sintattica\Atk\Core\Tools
的用法示例。
在下文中一共展示了Tools::useattrib方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: smartSearchPage
/**
* This method returns an html page that can be used as a search form.
*
* @param string $name
* @param array $criteria
*
* @return string The html search page.
*/
public function smartSearchPage($name = '', $criteria = array())
{
$node = $this->m_node;
$page = $this->getPage();
$ui = $this->getUi();
$sm = SessionManager::getInstance();
$page->register_script(Config::getGlobal('assets_url') . 'javascript/tools.js');
$page->register_script(Config::getGlobal('assets_url') . 'javascript/class.atksmartsearchhandler.js');
Tools::useattrib('atkdateattribute');
DateAttribute::registerScriptsAndStyles();
$params = [];
$params['formstart'] = '<form name="entryform" action="' . Config::getGlobal('dispatcher') . '" method="post" class="form">' . $sm->formState(SessionManager::SESSION_REPLACE) . '<input type="hidden" name="atkaction" value="smartsearch">' . '<input type="hidden" name="atknodeuri" value="' . $node->atkNodeUri() . '">';
$params['content'] = $this->invoke('smartSearchForm', $name, $criteria);
$params['buttons'][] = '<input type="submit" class="btn btn-default btn_search" name="atkdosearch" value="' . Tools::atktext('search', 'atk') . '">';
$params['formend'] = '</form>';
$action = $ui->renderAction('smartsearch', $params);
$box = $ui->renderBox(array('title' => $node->actionTitle('smartsearch'), 'content' => $action));
return $box;
}