How can i disable layout in zend framwork?
This topics show you, how you can disable layout
to disable layout use this line:
$this->_helper->layout->disableLayout();
This topics show you, how you can disable layout
to disable layout use this line:
$this->_helper->layout->disableLayout();
This topics show you, how you can change a default layout
to change layout use this line:
$this->_helper->layout->setLayout('admin');
This example show you how we can check if a use logged in
$auth = Zend_Auth::getInstance();
if (!$auth->hasIdentity()) {
if ('login' != $this->getRequest()->getActionName()) {
$this->_helper->getHelper('Redirector')->setGotoRoute(array(), 'MYROUTE');
}
}
Convert any "CamelCased" or "ordinary Word" into an "underscored_word"
Example:
$word = 'MyClassPHP';
echo strtolower(preg_replace('/[^A-Z^a-z^0-9]+/','_', preg_replace('/([a-z\d])([A-Z])/','\1_\2', preg_replace('/([A-Z]+)([A-Z][a-z])/','\1_\2',$word))));
Results:
my_class_php
Converts a word like "send_email" to "SendEmail". It will remove non aphanumeric character from the word, so "who's online" will be converted to "WhoSOnline"
Example:
$word = 'send_email';
echo str_replace(' ','',ucwords(preg_replace('/[^A-Z^a-z^0-9]+/',' ',$word)));
Result:
SendEmail