本文整理汇总了PHP中html::anchor方法的典型用法代码示例。如果您正苦于以下问题:PHP html::anchor方法的具体用法?PHP html::anchor怎么用?PHP html::anchor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html
的用法示例。
在下文中一共展示了html::anchor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$this->template->tasks = array(array('admin/blog/create', __('New Post')), array('admin/blog/comments', __('All comments')), array('admin/blog/settings', __('Edit Settings')));
$this->head->title->append('Blog');
$this->template->title = html::anchor('admin/blog', 'Blog') . ' | ';
}
示例2: add_photo
public function add_photo($id)
{
$album = ORM::factory("item", $id);
access::required("view", $album);
access::required("add", $album);
access::verify_csrf();
$file_validation = new Validation($_FILES);
$file_validation->add_rules("Filedata", "upload::valid", "upload::type[gif,jpg,png,flv,mp4]");
if ($file_validation->validate()) {
// SimpleUploader.swf does not yet call /start directly, so simulate it here for now.
if (!batch::in_progress()) {
batch::start();
}
$temp_filename = upload::save("Filedata");
try {
$name = substr(basename($temp_filename), 10);
// Skip unique identifier Kohana adds
$title = item::convert_filename_to_title($name);
$path_info = pathinfo($temp_filename);
if (array_key_exists("extension", $path_info) && in_array(strtolower($path_info["extension"]), array("flv", "mp4"))) {
$movie = movie::create($album, $temp_filename, $name, $title);
log::success("content", t("Added a movie"), html::anchor("movies/{$movie->id}", t("view movie")));
} else {
$photo = photo::create($album, $temp_filename, $name, $title);
log::success("content", t("Added a photo"), html::anchor("photos/{$photo->id}", t("view photo")));
}
} catch (Exception $e) {
unlink($temp_filename);
throw $e;
}
unlink($temp_filename);
}
print "File Received";
}
示例3: action_addFolder
public function action_addFolder()
{
$properties = array();
$properties["owner"] = Wi3::inst()->sitearea->auth->user;
$properties["adminright"] = Wi3::inst()->sitearea->auth->user->username;
$properties["title"] = "Nieuwe map";
$properties["type"] = "folder";
$properties["created"] = time();
$properties["filename"] = $properties["created"];
// needs to be unique
$settings = array();
if (isset($_POST["refid"]) and !empty($_POST["refid"]) and isset($_POST["location"]) and !empty($_POST["location"])) {
$settings["under"] = (int) preg_replace("/[^0-9]/", "", $_POST["refid"]);
}
// Add it
$folder = Wi3::inst()->sitearea->files->add($properties, $settings);
if ($folder) {
// Remove cache of everything, since we do not know how this change affects the site
Wi3::inst()->cache->removeAll();
$li = html::anchor($folder->id, $folder->title);
if ($folder->lft == 1 and $folder->rgt == 2) {
// The new folder is the only folder there is. For the javascript menu to work properly, we need to reload the page.
echo json_encode(array("scriptsbefore" => array("reload" => "window.location.reload();")));
} else {
echo json_encode(array("alert" => "map is aangemaakt", "scriptsafter" => array("adminarea.currentTree().addNode('treeItem_" . $folder->id . "','" . addslashes($li) . "')")));
}
} else {
echo json_encode(array("alert" => "map kon NIET aangemaakt worden"));
}
}
示例4: __construct
public function __construct()
{
parent::__construct();
// Inicio de Session
$this->session = Session::instance();
// Si la variable cat no está definida, definirla
if (!isset($_SESSION['cat'])) {
$_SESSION['cat'] = 0;
}
if (!isset($_SESSION['localidad'])) {
$_SESSION['localidad'] = 0;
}
$this->template->links = array('Acerca de IMGListados' => 'about', 'Datos' => 'datos', 'Rubros' => 'rubros', 'Exportar Listados' => 'listados');
$this->template->footer = 'Copyright ' . $this->thiYear($this->y) . ' - ' . html::anchor('http://www.imgdigital.com.ar', 'IMG Digital', array('target' => '_blank')) . '- ' . html::anchor('http://www.imgdigital.com.ar/imglistados', 'IMGListados', array('target' => '_blank'));
$this->template->login = new View('login');
// Da acceso a todos los controladores la base de datos
$this->db = Database::instance();
//Listado de Categorías
$this->categorias = ORM::factory('categoria')->select_list();
//$this->template->cats = $this->categorias;
//Listado de Localidades
$this->localidades = ORM::factory('localidad')->select_list();
//$this->template->localidades = $this->localidades;
//$this->profiler = new Profiler;
}
示例5: index
public function index()
{
$subview = new View('generic/grid');
$subview->tab = 'main';
$subview->section = 'general';
// What are we working with here?
$base = $this->getBaseModelObject();
// Setup the base grid object
$grid = jgrid::grid('Location', array('caption' => 'Locations'));
// If there is a base model that contains an account_id,
// then we want to show locations only that relate to this account
$base = $this->getBaseModelObject();
if ($base and !empty($base['account_id'])) {
// Set a where clause, if we're playing plug-in to someone else
$grid->where('account_id = ', $base['account_id']);
}
// Add the base model columns to the grid
$grid->add('location_id', 'ID', array('hidden' => TRUE, 'key' => TRUE));
$grid->add('name', 'Name');
$grid->add('domain', 'Domain');
// Add the actions to the grid
$grid->addAction('locationmanager/edit', 'Edit', array('arguments' => 'location_id', 'attributes' => array('class' => 'qtipAjaxForm')));
$grid->addAction('locationmanager/delete', 'Delete', array('arguments' => 'location_id', 'attributes' => array('class' => 'qtipAjaxForm')));
// Produces the grid markup or JSON
$subview->grid = $grid->produce();
$subview->gridMenu = html::anchor('/locationmanager/create', '<span>Add New Location</span>', array('class' => 'qtipAjaxForm'));
// Add our view to the main application
$this->views[] = $subview;
}
示例6: __construct
public function __construct()
{
parent::__construct();
$this->template->tasks = array(array('admin/user/create', __('New User')));
$this->head->title->append(__('User'));
$this->template->title = html::anchor('admin/user', __('User')) . ' | ';
}
示例7: action_index
public function action_index()
{
$calendar = new Calendar(Arr::get($_GET, 'month', date('m')), Arr::get($_GET, 'year', date('Y')));
$calendar->attach($calendar->event()->condition('timestamp', time())->output(html::anchor('http://google.de', 'google')));
$data = array('content' => $calendar->render());
$this->request->response = new View('index', $data);
}
示例8: index
/**
* ****************************************************
* HOME
* ****************************************************
*/
function index()
{
$vars = array();
$img = array();
$vars['img'] =& $img;
$img['up'] = 'images/icons/up.png';
$img['down'] = 'images/icons/down.png';
$img['edit'] = 'images/icons/edit.png';
$img['delete'] = 'images/icons/delete.png';
// action & id
$action = $this->validate->get->getRaw('action');
$action_list = array();
if (in_array($action, $action_list)) {
$this->{$action}();
}
$vars['nagavitor'] = $this->forum->get_nagavitor();
$vars['board_move_data'] = $this->forum->get_redirect_data();
$cats = $this->forum->get_category();
$vars['cats'] = array();
foreach ($cats as $key => $cat) {
$newcat = array();
$newcat['up'] = $newcat['down'] = '';
if ($key - 1 >= 0) {
$newcat['up'] = html::anchor('forum.php?c=admin&m=movecat&cat1=' . $cat['cat_id'] . '&order1=' . $cat['cat_order'] . '&cat2=' . $cats[$key - 1]['cat_order'] . '&order2=' . $cats[$key - 1]['cat_order'], html::img($img['up']));
}
if ($key + 2 <= count($cats)) {
$newcat['down'] = html::anchor('forum.php?c=admin&m=movecat&cat1=' . $cat['cat_id'] . '&order1=' . $cat['cat_order'] . '&cat2=' . $cats[$key + 1]['cat_id'] . '&order2=' . $cats[$key + 1]['cat_order'], html::img($img['down']));
}
$newcat['id'] = $cat['cat_id'];
$newcat['name'] = $cat['name'];
$vars['cats'][$key] = $newcat;
unset($newcat);
$vars['cats'][$key]['boards'] = array();
$catkey = $key;
// get the board data
$boards = array();
$this->forum->get_board_list2($cat['cat_id'], 0, $boards);
foreach ($boards as $key => $board) {
$newboard = array();
$newboard['up'] = $newboard['down'] = '';
$min_order = $this->forum->get_board_min_order($cat['cat_id'], $board['child_level'], $board['parent_id']);
$max_order = $this->forum->get_board_max_order($cat['cat_id'], $board['child_level'], $board['parent_id']);
if ($board['board_order'] > $min_order) {
$newboard['up'] = html::anchor('forum.php?c=admin&m=moveboard&board1=' . $board['board_id'] . '&order1=' . $board['board_order'] . '&board2=' . $boards[$key - 1]['board_id'] . '&order2=' . $boards[$key - 1]['board_order'], html::img($img['up']));
}
if ($board['board_order'] < $max_order) {
$newboard['down'] = html::anchor('forum.php?c=admin&m=moveboard&board1=' . $board['board_id'] . '&order1=' . $board['board_order'] . '&board2=' . $boards[$key + 1]['board_id'] . '&order2=' . $boards[$key + 1]['board_order'], html::img($img['down']));
}
$newboard['level'] = $board['child_level'];
$newboard['id'] = $board['board_id'];
$newboard['name'] = $board['name'];
$newboard['child_level'] = $board['name'];
$newboard['parent'] = $board['parent_id'];
$vars['cats'][$catkey]['boards'][] = $newboard;
unset($newboard);
}
}
$this->view->render('admin/index', $vars);
}
示例9: load
public function load()
{
$view = new View('report/view');
$this->template->title = 'Report Output';
$this->template->content = $view;
$this->page_breadcrumbs[] = html::anchor('report_viewer', 'Report Browser');
$this->page_breadcrumbs[] = $this->template->title;
}
示例10: testButtonLinkCreation
/**
* Test button link creation
*/
function testButtonLinkCreation()
{
$SUT = new Grid_Link('button');
$SUT->action('controller/method')->text('someText');
$link = $SUT->render();
$expected = html::anchor('controller/method', '<button type="button">someText</button>');
$this->assertEquals($expected, $link);
}
示例11: provideHelpLink
public function provideHelpLink()
{
$session = Session::instance();
$flashMessage =& Event::$data;
$hash = 'message_' . time();
$session->set($hash, $flashMessage);
$flashMessage .= html::anchor('errorreporter/inform/' . $hash, 'Help!', array('class' => 'support_help qtipAjaxForm', 'style' => 'float:right;'));
}
示例12: getlastnews
public static function getlastnews()
{
$orm = new fpp_news_Model();
$orm = $orm->db2cls();
$q = $orm->limit(0, 5)->fetch_all('id_news', 'DESC');
$pages = html::anchor(url::base() . 'webserv/listnews/', "Ver mas");
return View::factory("extras/news/lastnews")->set("news", $q)->set("pages", $pages)->render();
}
示例13: index
public function index()
{
$user = user::active();
user::logout();
log::info("user", t("User %name logged out", array("name" => $user->name)), html::anchor("user/{$user->id}", $user->name));
if ($this->input->get("continue")) {
url::redirect($this->input->get("continue"));
}
}
示例14: _user_info
private function _user_info()
{
if ($user = $this->a2->get_user()) {
$s = '<b>' . $user->username . ' <i>(' . $user->role . ')</i></b> ' . html::anchor('a2demo/logout', 'Logout');
} else {
$s = '<b>Guest</b> ' . html::anchor('a2demo/login', 'Login') . ' - ' . html::anchor('a2demo/create', 'Create account');
}
return '<div style="width:100%;padding:5px;background-color:#AFB6FF;">' . $s . '</div>';
}
示例15: nagavitor
function nagavitor($nagavitor, $seperator = '::')
{
$sets = array();
foreach ($nagavitor as $k => $v) {
$sets[] = html::anchor($v[0], $v[1]);
}
$sets = array_reverse($sets);
return implode(' ' . $seperator . ' ', $sets);
}