See some additional code snippet, this was placed in MyApp_Resource_View
(extends Zend_Application_Resource_ResourceAbstract)
$module = $request->getModuleName();
$controller = $request->getControllerName();
$actionName = $request->getActionName();
$moduleDir = $frontController->getModuleDirectory($module);
$viewRenderer =
Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$scriptPath =
realpath("$moduleDir/views/{$session->theme}/$controller/$actionName.phtml");
if (file_exists($scriptPath))
$viewRenderer->setViewBasePathSpec(':moduleDir/views/'.
$session->theme);
else
$viewRenderer->setViewBasePathSpec(':moduleDir/views/default');
$viewRenderer->setView($view);
- Nomolos
On Tue, Nov 23, 2010 at 8:10 AM, Maxim Savenko <maxim.savenko@gmail.com>wrote:
> Hi Nomolos,
>
> Thank you, but my question isn't related to public folder.
>
> Anyway thanx to all you guys. I think that setScriptPath in predispatch
> callback is the most simple way. However, extending Zend_View with the new
> base vew structure is fine too.
>
> Thank you
>
> Maxim Savenko
> maxim.savenko@gmail.com
>
>
> 2010/11/23 Nomolos Sharpe <nomolossharpe@gmail.com>
>
> Maxim,
>>
>> I think this article maybe able to help.
>>
>> http://www.kharysharpe.com/?p=3
>>
>> Cheers,
>>
>> Nomolos
>>
>>
>>
>>
>> On Mon, Nov 22, 2010 at 10:14 AM, Maxim Savenko <maxim.savenko@gmail.com>wrote:
>>
>>> I'd like to slightly change the layout of base Zend_View directory
>>> layout.
>>> The current layout is as follows:
>>>
>>> view
>>> filters
>>> helpers
>>> scripts
>>>
>>> ... and I'd like to split script directory to several
>>> directories(themes),
>>> depending on a theme user will choose.
>>> For example:
>>>
>>> view
>>> filters
>>> helpers
>>> scripts
>>> default
>>> modern
>>> classic
>>>
>>> What is the best way to shoot the bull?
>>>
>>> Thank you,
>>> Maxim Savenko
>>> maxim.savenko@gmail.com
>>>
>>
>>
>>
>> --
>> Regards,
>>
>> Nomolos
>>
>
>
--
Regards,
Nomolos
没有评论:
发表评论