Would like some help with tab control getting tabcontrol not found error
- kc2scy
- Member | 22
Hello,
I'm tiring to figure out how to use the tab control.
I downloaded the control and I place the following files in my model
directory:
TabControl.php
Tap.php
I then tried to reference the contol like this:
\model\TabControl,
\model\Tab,
..
As a quick test to see if would work I set a createComponentTabs:
public function createComponentTabs() {
$tc = new TabControl();
$tc->mode = TabControl::MODE_AUTO; // Výchozí
$tc->sortable = true;
$t = $tc->addTab("logon");
$t->header = "<i>Logon</i>Grid";
$t->contentFactory = array($this,"createComponentProfileForm");
$t->hasSnippets = true;
}
I get the follwing error:
Fatal Error
Class 'model\TabControl' not found search►
I'm really not sure if I going about this correctly, I have never tried to use a componets and I'm still learning the framework.
Last edited by kc2scy (2014-02-08 04:28)
- Aurielle
- Member | 1281
You need to take a look at the namespaces in TabControl and Tab and reference the classes accordingly to them. Namespaces are not identical to directory structure, even though many projects follow this standard (Google PSR-0 for details). The important thing to understand is that a file's physical location and its namespace can be completely different.
- Jan Tvrdík
- Nette guru | 2595
@kc2scy: TabControl was last updated 4 years ago and is unlikely to work with the current version of Nette.
- Jan Tvrdík
- Nette guru | 2595
I have been trying different things and I can't get it to work.
I don't know what you have been trying so I can't tell you what have you done wrong.