Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GeehNiblett to override view templates in ZfCUser
<?php
return [
'modules' => [
ZfcBase,
ZfcUser,
// ** custom modules **//
GeehNiblett, // The overriding ZfcUser view template module
],
];
<?php
return array (
'view_manager' => array(
'template_path_stack' => array(
'zfcuser' => __DIR__ . '/../view',
),
),
);
<?php
namespace GeehNiblett;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
class Module implements AutoloaderProviderInterface, ConfigProviderInterface
{
public function init($moduleManager)
{
$moduleManager->loadModule('ZfcUser');
}
/**
* Return an array for passing to Zend\Loader\AutoloaderFactory.
*
* @return array
*/
public function getAutoloaderConfig()
{
return [];
}
/**
* Returns configuration to merge with application configuration
*
* @return array|\Traversable
*/
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
}
<div style="float:left; padding-right:16px;"><?php echo $this->gravatar($this->zfcUserIdentity()->getEmail()) ?></div>
<h3><?php echo $this->translate('Hello'); ?>, <?php echo $this->zfcUserDisplayName() ?>!</h3>
<a href="<?php echo $this->url('zfcuser/logout') ?>">[<?php echo $this->translate('Sign Out'); ?>]</a>
<div style="clear:both;"></div>
<h1><?php echo $this->translate('Sign In'); ?> NEW!!!</h1>
<?php
$form = $this->loginForm;
$form->prepare();
$form->setAttribute('action', $this->url('zfcuser/login'));
$form->setAttribute('method', 'post');
$form->setAttribute('class', 'form-signin');
$form->get('submit')->setAttribute('class', 'btn btn-lg btn-primary btn-block');
?>
<?php echo $this->form()->openTag($form) ?>
<dl class="zend_form">
<?php echo $this->formElementErrors($form->get('identity')) ?>
<dt><?php echo $this->formLabel($form->get('identity')) ?></dt>
<dd><?php echo $this->formInput($form->get('identity')) ?></dd>
<dt><?php echo $this->formLabel($form->get('credential')) ?></dt>
<dd><?php echo $this->formInput($form->get('credential')) ?></dd>
<?php if ($this->redirect): ?>
<input type="hidden" name="redirect" value="<?php echo $this->escapeHtml($this->redirect) ?>" />
<?php endif ?>
<dd><?php echo $this->formButton($form->get('submit')) ?></dd>
</dl>
<?php echo $this->form()->closeTag() ?>
<?php if ($this->enableRegistration) : ?>
<?php echo $this->translate('Not registered?'); ?> <a href="<?php echo $this->url('zfcuser/register') . ($this->redirect ? '?redirect='.$this->escapeUrl($this->redirect) : '') ?>"><?php echo $this->translate('Sign up!'); ?></a>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.