本文整理汇总了PHP中Phalcon\Tag::displayTo方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::displayTo方法的具体用法?PHP Tag::displayTo怎么用?PHP Tag::displayTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phalcon\Tag
的用法示例。
在下文中一共展示了Tag::displayTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editAction
public function editAction($id)
{
$request = $this->request;
if (!$request->isPost()) {
$producttypes = ProductTypes::findFirst(array('id=:id:', 'bind' => array('id' => $id)));
if (!$producttypes) {
$this->flash->error("Product type to edit was not found");
return $this->forward("producttypes/index");
}
$this->view->setVar("id", $producttypes->id);
Tag::displayTo("id", $producttypes->id);
Tag::displayTo("name", $producttypes->name);
}
}
示例2: editAction
public function editAction($id)
{
$request = $this->request;
if (!$request->isPost()) {
$categories = Categories::findFirst(array('id = :id:', 'bind' => array('id' => $id)));
if (!$categories) {
$this->flash->error("The category was not found");
return $this->dispatcher->forward(array("controller" => "categories", "action" => "index"));
}
$this->view->setVar("id", $categories->id);
Tag::displayTo("id", $categories->id);
Tag::displayTo("name", $categories->name);
Tag::displayTo("slug", $categories->slug);
}
}
示例3: editAction
public function editAction($id)
{
$request = $this->request;
if (!$request->isPost()) {
$companies = Companies::findFirst(array('id=:id:', 'bind' => array('id' => $id)));
if (!$companies) {
$this->flash->error("companies was not found");
return $this->forward("companies/index");
}
$this->view->setVar("id", $companies->id);
Tag::displayTo("id", $companies->id);
Tag::displayTo("name", $companies->name);
Tag::displayTo("telephone", $companies->telephone);
Tag::displayTo("address", $companies->address);
Tag::displayTo("city", $companies->city);
}
}
示例4: editAction
public function editAction($id)
{
$request = $this->request;
if (!$request->isPost()) {
$id = $this->filter->sanitize($id, array("int"));
$counts = Counts::findFirst('id="' . $id . '"');
if (!$counts) {
$this->flash->error("counts was not found");
return $this->dispatcher->forward(array("controller" => "counts", "action" => "index"));
}
$this->view->setVar("id", $counts->id);
Tag::displayTo("id", $counts->id);
Tag::displayTo("links_id", $counts->links_id);
Tag::displayTo("value", $counts->value);
Tag::displayTo("visit_date", $counts->visit_date);
Tag::displayTo("visitor_ip", $counts->visitor_ip);
}
}
示例5: editAction
public function editAction($id)
{
return true;
$request = $this->request;
if (!$request->isPost()) {
$id = $this->filter->sanitize($id, array("int"));
$links = Links::findFirst('id="' . $id . '"');
if (!$links) {
$this->flash->error("links was not found");
return $this->dispatcher->forward(array("controller" => "links", "action" => "index"));
}
$this->view->setVar("id", $links->id);
Tag::displayTo("id", $links->id);
Tag::displayTo("token", $links->token);
Tag::displayTo("longurl", $links->longurl);
Tag::displayTo("visitor_count", $links->visitor_count);
}
}
示例6: editAction
public function editAction($id)
{
$request = $this->request;
if (!$request->isPost()) {
$id = $this->filter->sanitize($id, array("int"));
$products = Products::findFirst('id="' . $id . '"');
if (!$products) {
$this->flash->error("products was not found");
return $this->forward("products/index");
}
$this->view->setVar("id", $products->id);
Tag::displayTo("id", $products->id);
Tag::displayTo("product_types_id", $products->product_types_id);
Tag::displayTo("name", $products->name);
Tag::displayTo("price", $products->price);
Tag::displayTo("active", $products->active);
$this->view->setVar("productTypes", ProductTypes::find());
}
}
示例7: editAction
public function editAction($id)
{
$request = $this->request;
if (!$request->isPost()) {
$id = $this->filter->sanitize($id, array("int"));
$user = User::findFirst('id="' . $id . '"');
if (!$user) {
$this->flash->error("user was not found");
return $this->dispatcher->forward(array("controller" => "user", "action" => "index"));
}
$this->view->setVar("id", $user->id);
Tag::displayTo("id", $user->id);
Tag::displayTo("username", $user->username);
Tag::displayTo("fullname", $user->fullname);
Tag::displayTo("email", $user->email);
Tag::displayTo("password", $user->password);
Tag::displayTo("role", $user->role);
Tag::displayTo("active", $user->active);
Tag::displayTo("last_login_time", $user->last_login_time);
Tag::displayTo("create_time", $user->create_time);
Tag::displayTo("update_time", $user->update_time);
}
}
示例8: editAction
public function editAction($id = null)
{
if (!$this->request->isPost() && !$this->request->isAjax()) {
$id = $this->filter->sanitize($id, array("int"));
$model = $this->loadModel($id);
$this->view->setVar("id", $model->id);
Tag::displayTo("name", $model->name);
} elseif ($this->request->isPost() && !$this->request->isAjax()) {
$id = $this->request->getPost('id', 'int');
$model = $this->loadModel($id);
if (!$model->update($_POST)) {
foreach ($model->getMessages() as $message) {
$this->flashSession->error((string) $message->getMessage());
//echo var_dump($message->getType());
//echo var_dump($message->getMessage());
}
return $this->response->redirect('backend/articleCategories/edit/' . $model->id);
} else {
$this->flashSession->success("Статья удачно обновлена");
return $this->response->redirect("backend/articleCategories");
}
}
}
示例9: editAction
public function editAction($id)
{
$request = $this->request;
if (!$request->isPost()) {
$id = $this->filter->sanitize($id, array("int"));
$insertion = Insertion::findFirst('id="' . $id . '"');
if (!$insertion) {
$this->flash->error("insertion was not found");
return $this->dispatcher->forward(array("controller" => "insertion", "action" => "index"));
}
$this->view->setVar("id", $insertion->id);
Tag::displayTo("id", $insertion->id);
Tag::displayTo("category", $insertion->category);
Tag::displayTo("body", $insertion->body);
Tag::displayTo("status", $insertion->status);
Tag::displayTo("price_range", $insertion->price_range);
Tag::displayTo("price", $insertion->price);
Tag::displayTo("buy_sell", $insertion->buy_sell);
Tag::displayTo("create_user_id", $insertion->create_user_id);
Tag::displayTo("update_user_id", $insertion->update_user_id);
Tag::displayTo("create_time", $insertion->create_time);
Tag::displayTo("update_time", $insertion->update_time);
}
}
示例10: editAction
public function editAction($id = null)
{
$this->assets->addCss('css/select2.css');
$this->assets->addJs('js/select2.js');
if (!$this->request->isPost() && !$this->request->isAjax()) {
$id = $this->filter->sanitize($id, array("int"));
$model = $this->loadModel($id);
if (!$model) {
$this->flashSession->error("Новость не найдена");
$this->response->redirect("backend/posts/index");
}
$this->view->setVar("id", $model->id);
$this->view->setVar('tags', \Models\Tags::getTagsForSelect());
Tag::displayTo("id", $model->id);
Tag::displayTo("title", $model->title);
Tag::displayTo("body", $model->body);
Tag::displayTo("status", $model->status);
Tag::displayTo("tags", $model->tags);
} elseif ($this->request->isPost() && !$this->request->isAjax()) {
$auth = $this->session->get('auth');
if (!$auth) {
return $this->response->redirect();
}
$id = $this->request->getPost('id', 'int');
$model = $this->loadModel($id);
if (!$model) {
$this->flashSession->error("Ничего не найдено");
$this->response->redirect("backend/posts/index");
}
$model->author_id = $auth['id'];
if (!$model->update($_POST)) {
foreach ($model->getMessages() as $message) {
$this->flashSession->error((string) $message->getMessage());
//echo var_dump($message->getType());
//echo var_dump($message->getMessage());
}
return $this->response->redirect('backend/posts/edit/' . $model->id);
} else {
$this->flashSession->success("Запись удачно обновлена");
return $this->response->redirect("backend/posts");
}
}
}
示例11: testFieldParameter
/**
* Runs the test for a Tag::$function with $options
*
* @param string $function
* @param mixed $options
* @param string $expected
* @param boolean $xhtml
* @param string $set
*/
public function testFieldParameter($function, $options, $expected, $xhtml, $set = '')
{
Tag::resetInput();
if ($xhtml) {
Tag::setDocType(Tag::XHTML10_STRICT);
$expected .= ' />';
} else {
Tag::setDocType(Tag::HTML5);
$expected .= '>';
}
if ($set) {
Tag::displayTo('x_name', 'x_value');
}
$actual = Tag::$function($options);
if ($set) {
Tag::$set('x_name', '');
}
$this->assertEquals($expected, $actual);
}
示例12: editAction
public function editAction($id)
{
$this->assets->addJs('js/jquery.MultiFile.pack.js');
if (!$this->request->isPost() && !$this->request->isAjax()) {
$id = $this->filter->sanitize($id, array("int"));
$model = $this->loadModel($id);
if (!$model) {
$this->flashSession->error("Новость не найдена");
$this->response->redirect("backend/news/index");
}
$this->view->setVar("id", $model->id);
$this->view->setVar('images', $model->getImages());
Tag::displayTo("id", $model->id);
Tag::displayTo("title", $model->title);
Tag::displayTo("body", $model->body);
Tag::displayTo("status", $model->status);
} elseif ($this->request->isPost() && !$this->request->isAjax()) {
$auth = $this->session->get('auth');
if (!$auth) {
return $this->response->redirect();
}
$id = $this->request->getPost('id', 'int');
$model = $this->loadModel($id);
if (!$model) {
$this->flashSession->error("Новость не найдена");
$this->response->redirect("backend/news/index");
}
$model->update_user_id = $auth['id'];
if (!$model->update($_POST)) {
foreach ($model->getMessages() as $message) {
$this->flashSession->error((string) $message->getMessage());
//echo var_dump($message->getType());
//echo var_dump($message->getMessage());
}
return $this->response->redirect('backend/news/edit/' . $model->id);
} else {
$this->SaveImages($model);
$this->flashSession->success("Новость удачно обновлена");
return $this->response->redirect("backend/news");
}
}
}
示例13: changetypesAction
public function changetypesAction($id)
{
if ($id) {
$newstype = Newstype::findFirst("id =" . $id);
Tag::displayTo("id", $newstype->id);
Tag::displayTo("name", $newstype->name);
} else {
$this->flash->error("错误");
}
}
示例14: accountAction
public function accountAction($id)
{
$id = $this->filter->sanitize($id, array("int"));
$userInfo = Users::findFirst('did = "' . $id . '"');
if (!$userInfo) {
$this->flash->notice("还木有帐号,请创建并保存");
$this->view->setVar("aid", $id);
Tag::displayTo("did", $id);
Tag::setDefault('email', ' ');
Tag::setDefault('password', '');
$this->view->pick("session/register");
} else {
$this->view->setVar("aid", $id);
Tag::displayTo("id", $userInfo->id);
Tag::displayTo("username", $userInfo->username);
Tag::displayTo("name", $userInfo->name);
Tag::displayTo("email", $userInfo->email);
}
}
示例15: newtypesAction
public function newtypesAction($id)
{
Tag::displayTo("fid", $id);
$this->view->form = $this->getForm();
}