For February, I won't be able to make it due to a prior conflict, so for
February anyone who wants to present anything just e-mail me. The
meeting should take place on Feb 21st.
--
Chris
Bud
Sent from my iPhone
[code]
$view = new Zend_View();
$view->setScriptPath(APPLICATION_PATH . "/views/scripts/menu");
/* skip some stuff */
$view->render('nameofscript.php');
[/code]
I get Zend_View_Exception with message: "script "nameofscript.php" not found in path (/path/to/script/views/scripts/menu/). However, the script is located in the folder specified (on the server side--yes I checked). Anybody have a clue how to resolve this?
Thanks,
THOMAS POWERS | SENIOR WEB DEVELOPER |
GERMAN MUTUAL INSURANCE
Work: (419) 599-3993 Ext: 252 | Mobile: (419) 591-6064 |
Email: thomas...@heartland-ins.com | Website: http://www.heartland-ins.com
Tuesdays & Fridays: (419) 966-4079
Ron Paul - VOTE FOR FREEDOM!
"True patriotism is more closely linked to dissent than it is to conformity and a blind desire for safety and security." - Congressman Ron Paul (TX)
Thanks,
THOMAS POWERS | SENIOR WEB DEVELOPER |
GERMAN MUTUAL INSURANCE
Work: (419) 599-3993 Ext: 252 | Mobile: (419) 591-6064 |
Email: thomas...@heartland-ins.com | Website: http://www.heartland-ins.com
Tuesdays & Fridays: (419) 966-4079
"True patriotism is more closely linked to dissent than it is to conformity and a blind desire for safety and security." - Congressman Ron Paul (TX)
Thanks,
--
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
-Chris
On 2/21/2012 2:37 PM, Thomas Powers wrote:
> Wondered if anyone here could help out. I've setup a new Zend Framework skeleton for the new design of our company website. In the PHP script, I create a new view.
>
> [code]
> $view = new Zend_View();
> $view->setScriptPath(APPLICATION_PATH . "/views/scripts/menu");
>
> /* skip some stuff */
>
> $view->render('nameofscript.php');
> [/code]
>
> I get Zend_View_Exception with message: "script "nameofscript.php" not found in path (/path/to/script/views/scripts/menu/). However, the script is located in the folder specified (on the server side--yes I checked). Anybody have a clue how to resolve this?
>
> Thanks,
>
> THOMAS POWERS | SENIOR WEB DEVELOPER |
> GERMAN MUTUAL INSURANCE
> Work: (419) 599-3993 Ext: 252 | Mobile: (419) 591-6064 |
> Email: thomas...@heartland-ins.com | Website: http://www.heartland-ins.com
> Tuesdays& Fridays: (419) 966-4079
Portion of Config File (below)
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
---------------End File-------------
Portion of Bootstrap File (below)
protected function _initAutoloadModules()
{
$moduleLoader = new Zend_Application_Module_Autoloader(
array (
'namespace' => '',
'basePath' => APPLICATION_PATH
),
array (
'namespace' => 'docs',
'basePath' => APPLICATION_PATH . '/modules/docs'
)
);
return $moduleLoader;
}
protected function _initFCPlugins()
{
Zend_Layout::starMvc();
$this->bootstrap('frontController');
$this->bootstrap('RegisterNamespaces');
$fc = $this->getResource('frontController');
$fc->registerPlugin(new Tws_Controller_Plugin_ModuleLayout());
$fc->registerPlugin(new Gmic_Plugin_Module());
return $fc;
}
class Gmic_Plugin_Module extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$module = $request->getModuleName();
$layout = Zend_Layout::getMvcInstance();
$layoutsDir = $layout->getLayoutPath();
if (file_exists($layoutsDir . DIRECTORY_SEPARATOR . $module . ".phtml")) {
$layout->setLayout($module . "-layout");
} else {
$layout->setLayout('layout');
}
}
}
---------------End File--------------
I'm trying to access APP_PATH . "/agent/docs/index". There are two modules, I have the default and then docs (at this point). As you can see from the parameters list at the bottom, the module is docs, the controller is index, yet it doesn't "exist".
<***** ERROR THAT I GET ******>
An error occurred
Page not found
Exception information:
Message: Action "index" does not exist and was not trapped in __call()
Stack trace:
#0 /var/www/projects/powerst/shared-library/Zend/Controller/Action.php(515): Zend_Controller_Action->__call('indexAction', Array)
#1 /var/www/projects/powerst/shared-library/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('indexAction')
#2 /var/www/projects/powerst/shared-library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#3 /var/www/projects/powerst/shared-library/Zend/Application/Bootstrap/Bootstrap.php(77): Zend_Controller_Front->dispatch()
#4 /var/www/projects/powerst/shared-library/Zend/Application.php(346): Zend_Application_Bootstrap_Bootstrap->run()
#5 /var/www/projects/powerst/agent/public/index.php(35): Zend_Application->run()
#6 {main}
Request Parameters:
array(3) {
["module"]=>
string(4) "docs"
["controller"]=>
string(5) "index"
["action"]=>
string(5) "index"
}
------------- END ERROR ------------
I have a bootstrap for the docs module, as well. The IndexController for Docs is Docs_IndexController. Anyone know what I'm missing here?
THOMAS POWERS | SENIOR WEB DEVELOPER |
GERMAN MUTUAL INSURANCE
Work: (419) 599-3993 Ext: 252 | Mobile: (419) 591-6064 |
Email: thomas...@heartland-ins.com | Website: http://www.heartland-ins.com
Tuesdays & Fridays: (419) 966-4079
"True patriotism is more closely linked to dissent than it is to conformity and a blind desire for safety and security." - Congressman Ron Paul (TX)
Okay. Now I am having an issue with modules. I cannot get the app to "see" my module. First off, I feel quite comfortable with ZF, but when it comes to modules, I get wrapped up in confusion. I'll try to explain the best that I can.
Portion of Config File (below)
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
---------------End File-------------
Portion of Bootstrap File (below)
protected function _initAutoloadModules()
{
$moduleLoader = new Zend_Application_Module_Autoloader(
array (
'namespace' => '',
'basePath' => APPLICATION_PATH
),
array (
'namespace' => 'docs',
'basePath' => APPLICATION_PATH . '/modules/docs'
)
);
return $moduleLoader;
}
protected function _initFCPlugins()
{
Zend_Layout::starMvc();
$this->bootstrap('frontController');
$this->bootstrap('RegisterNamespaces');
$fc = $this->getResource('frontController');
$fc->registerPlugin(new Tws_Controller_Plugin_ModuleLayout());
$fc->registerPlugin(new Gmic_Plugin_Module());
return $fc;
}
class Gmic_Plugin_Module extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$module = $request->getModuleName();
$layout = Zend_Layout::getMvcInstance();
$layoutsDir = $layout->getLayoutPath();
if (file_exists($layoutsDir . DIRECTORY_SEPARATOR . $module . ".phtml")) {
$layout->setLayout($module . "-layout");
} else {
$layout->setLayout('layout');
}
}
}
THOMAS POWERS | SENIOR WEB DEVELOPER |
GERMAN MUTUAL INSURANCE
Work: (419) 599-3993 Ext: 252 | Mobile: (419) 591-6064 |
Email: thomas...@heartland-ins.com | Website: http://www.heartland-ins.com
Tuesdays & Fridays: (419) 966-4079
"True patriotism is more closely linked to dissent than it is to conformity and a blind desire for safety and security." - Congressman Ron Paul (TX)