42
« il: 28 Ott 2014, 18:11:55 »
Ciao a tutti,
sto cercando di creare una lista dei record su una tabella con le relative action (nuovo, modifica, elimina)... sembra tutto a posto ma nel premere i tasti ci da " [/size]View non trovato [name, type, prefix]: photwo, html, photwoView[/color][/size][size=78%]"[/size]
[/size]
[/size][size=78%]view.html.php[/size]<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
/**
* HelloWorld View
*/
class PhoTwoViewPhoTwos extends JViewLegacy
{
/**
* display method of Hello view
* @return void
*/
public function display($tpl = null)
{
// get the Data
$items = $this->get('Items');
$pagination = $this->get('Pagination');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Assign the Data
$this->items = $items;
$this->pagination = $pagination;
// Set the toolbar and number of found items
$this->addToolBar($this->pagination->total);
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
}
/**
* Setting the toolbar
*/
protected function addToolBar($total=null)
{
JToolBarHelper::title(JText::_('COM_HELLOWORLD_MANAGER_HELLOWORLDS'));
JToolBarHelper::deleteList('', 'photwos.delete');
JToolBarHelper::editList('photwo.edit');
JToolBarHelper::addNew('photwo.add');
}
/**
* Method to set up the document properties
*
* @return void
*/
protected function setDocument()
{
$isNew = ($this->item->id < 1);
$document = JFactory::getDocument();
$document->setTitle($isNew ? JText::_('COM_HELLOWORLD_HELLOWORLD_CREATING')
: JText::_('COM_HELLOWORLD_HELLOWORLD_EDITING'));
}}