Would like some help with tab control getting tabcontrol not found error

Notice: This thread is very old.
kc2scy
Member | 22
+
0
-

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
+
0
-

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.

kc2scy
Member | 22
+
0
-

Hello Aurielle,
yes namespaces are correct, I going to have to take a step back and look at this again, maybe I should look into using the JQuery-UI directly (if that's even possible)

Jan Tvrdík
Nette guru | 2561
+
0
-

@kc2scy: TabControl was last updated 4 years ago and is unlikely to work with the current version of Nette.

kc2scy
Member | 22
+
0
-

Jan Tvrdík wrote:

@kc2scy: TabControl was last updated 4 years ago and is unlikely to work with the current version of Nette.

Yes I think your right, do you know how I could use the Jquery-ui tab I have been trying different things and I can't get it to work.

Jan Tvrdík
Nette guru | 2561
+
0
-

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.