I have a little problem, actually there are two but I think I can't ask two questions on this same page.
I am not creating a new button, on one page, I literally copied it from another and the changes do not work, here I show you the codes:
Codes of the button on which I am basing ConfigController.php
public function assesor_index($active_pill = null)
{
$this->layout = 'assesor';
$user = $this->Auth->user();
$doctor = $user['Doctor'];
$pendings = $this->AppointmentUser->find('all', array(
'conditions' => array('appointment_state_id' => '1', 'doctor_id' => $user['Doctor']['id']),
'order' => array('date_created DESC')));
$appointments = $this->AppointmentUser->find('all', array(
'conditions' => array('appointment_state_id' => '2', 'doctor_id' => $user['Doctor']['id']),
'order' => array('date_created DESC')));
$effectives = $this->AppointmentUser->find('all', array(
'conditions' => array('appointment_state_id' => '3', 'doctor_id' => $user['Doctor']['id']),
'order' => array('date_created DESC')));
$todoctor = $this->AppointmentUser->find('all', array(
'conditions' => array('appointment_state_id' => '4', 'doctor_id' => $user['Doctor']['id']),
'order' => array('date_created DESC')));
$noteffective = $this->AppointmentUser->find('all', array(
'conditions' => array('appointment_state_id' => '5', 'doctor_id' => $user['Doctor']['id']),
'order' => array('date_created DESC')));
$this->set(compact('appointments', 'pendings', 'effectives', 'todoctor', 'doctor', 'noteffective', 'active_pill'));
}
Here is located the menu which is in elements and is called assessor_menu.ctp, the second li was the one I created, and I based on the first to create it but it doesn't work
<li>
<?php
echo $this->Html->link('<div><i class="fa fa-user-md fa-fw"></i> Consultas </div>',
array('controller' => 'config', 'action' => 'index', 'assesor' => true),
array('escape' => false));
?>
</li>
<li>
<?php
echo $this->Html->link('<div class="clickPoliticasWeb"><i class="fa fa-user-md fa-fw"></i> Politicas del sitio web</div>',
array('controller' => 'config', 'action' => 'index', 'politics' => true),
array('escape' => false));
?>
</li>
<li>
<?php
echo $this->Html->link('<i class="fa fa-sign-out fa-fw"></i> Salir',
array('controller' => 'users', 'action' => 'logout', 'admin' => true),
array('escape' => false)
);
?>
</li>
The strange thing is that in the source code you can see another path The path should be policies/config ps the one for the button that already existed is assessor/config
Layouts: Assesors.ctp and Politics.ctp for now have the same thing, but Politics doesn't load for me, it's as if it couldn't find it. The only difference is that I put an input text on one of the two, and if that input is in politics it doesn't show it, if it's in advisors, ps if it shows it.
<?php
$pageDescription = __d('seadog_base', 'SEADOG Base');
$pageName = __d('seadog_base', 'IQ Administración');
?>
<!DOCTYPE html>
<html lang="es-ES">
<head>
<?php echo $this->Html->charset(); ?>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
<?php echo $pageName.' :'; ?>
<?php echo $title_for_layout; ?>
</title>
<?php
echo $this->Html->meta('keywords','SEADOG, dessign, creativity, lab, Endor inc');
echo $this->Html->meta('description', 'Seadog base template');
echo $this->Html->meta('language', 'es');
echo $this->Html->meta('favicon.ico', '/img/favicon.ico', array('type' => 'icon'));
/* CSS */
echo $this->Html->css(array(
'bootstrap.min',
'metisMenu.min',
'admin',
'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css',
));
/* JS */
echo $this->Html->script(array(
'jquery.min',
'../ckeditor/ckeditor', '../ckeditor/config', /* ckeditor */
));
//this is loaded at the end of the page.
echo $this->Html->script(array(
'metisMenu.min',
'bootstrap.min',
'admin',
), array('async' => 'async', 'block' => 'scriptBottom')
);
echo $this->fetch('meta');
echo $this->fetch('css');
echo $this->fetch('script');
?>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<?php echo $this->element('assesor_menu'); ?>
<!--nocache-->
<!-- display session messaging -->
<div id="flassMessage" class="container">
<?php $flashMessage = $this->Session->flash();
if($flashMessage){
echo '<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>';
echo $flashMessage;
echo '</div>';
}
$flash_auth = $this->Session->flash('auth');
if($flash_auth){
echo '<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>';
echo $flash_auth;
echo '</div>';
}
?>
</div> <!-- end flash -->
<!--/nocache-->
<!-- display page content -->
<input type="text" name="vlr">
<?php echo $this->fetch('content'); ?>
</div> <!-- end wrapper -->
<?php echo $this->fetch('scriptBottom'); //header scripts ?>
<?php echo $this->element('sql_dump'); ?>
<?php echo $this->Js->writeBuffer(); // Write cached scripts ?>
</body>
</html>
policy controller
public function politics_index($active_pill = null)
{
$this->set(compact());
}
photo change 1:
It's like when trying to enter:
<a href="/politics/config"><div><i class="clickPoliticasWeb fa fa-user-md fa-fw"></i> Politicas del sitio web</div></a> </li>
wont let me
The reason it doesn't work is because you haven't declared the prefix in
core.php
.The HtmlHelper, not having that prefix in the configuration, is taking a
'politics' => true
as an extra parameter and therefore adds it to the end of the URL.In your file
core.php
add to the array of prefixespolitics