impresspages / ImpressPages

ImpressPages is php framework with admin panel. Build functional website in one hour.
http://www.impresspages.org
Other
501 stars 175 forks source link

dont work custom layout just for one particular menu #712

Open skavehmousavi opened 9 years ago

skavehmousavi commented 9 years ago

This is not working: <?php echo ipSlot('menu', array( 'items' =>'menu1', 'view' => 'Theme/new2/view/mymenuview.php' )); ?>error :

Fatal error: Uncaught exception 'Ip\Exception\View' with message 'View Theme/new2/view/mymenuview.php not found.' in /home/sdjhfsjh/domains/my website/public_html/Ip/Functions.php:886 Stack trace:

0 /home/sdjhfsjh/domains/my website/public_html/Ip/Internal/Core/Slot.php(127): ipView('Theme/new2/view...', Array)

1 [internal function]: Ip\Internal\Core\Slot::menu_80(Array)

2 /home/sdjhfsjh/domains/my website/public_html/Ip/Internal/Dispatcher/JobDispatcher.php(39): call_user_func('\Ip\Internal\Co...', Array)

3 /home/sdjhfsjh/domains/my website/public_html/Ip/Dispatcher.php(113): Ip\Internal\Dispatcher\JobDispatcher->handle('menu', Array)

4 /home/sdjhfsjh/domains/my website/public_html/Ip/Internal/Slots.php(16): Ip\Dispatcher->slot('menu', Array)

5 /home/sdjhfsjh/domains/my website/public_html/Ip/Functions.php(307): Ip\Internal\Slots->generateSlot('menu', Array)

6 /home/sdjhfsjh/domains/my website/public_html/Theme/New2/main.php(22): ipSlot('menu', Array)

7 /hom in /home/sdjhfsjh/domains/my website/public_html/Ip/Functions.php on line 886

jankus commented 9 years ago

The error says that a file doesn't exist. So it works, just cannot find the specified file.

Did you double-check that file exist in that location? I have a suspicion that the path is wrong since themes usually don't have "view" folder in them.

skavehmousavi commented 9 years ago

All files available working in local But in host does not work

TheFOBas commented 9 years ago

Try using IP functions for files. In this case there is function ipThemeFile ( string $path ). Function will point to file in theme directory, in this case use ipThemeFile('view/mymenuview.php');

maskas commented 9 years ago

doublecheck the case of letters. Does your theme really is "new2", not "New2", etc. Also check file permissions. Maybe the file exists, but PHP can't read it.

By the way, TheFOBas idea is not bad either.

maskas commented 9 years ago

By the way, I've just tested this feature in the way skavehmousavi is using it. It is working fine.