简体   繁体   中英

How to assign a value into the href of an anchor using HMVC

<a href="{seolink module='listings' method='view' data=$item}">{$item.output_name}</a>

Could anyone kindly explain what exactly happening there. I got that it is passing $item to the view method of a listings module and what is that seolink.

Kindly help me out.

如果我是你,我本可以尝试

<a href = "<?php echo base_url();?>/module/function_name"></a>

I have same problem! I have a Virtual host and using the laragon instead of Xampp. I am working with HMVC Codeigniter and I have defined the base_url in config.php as: hmvc.test. It is working perfectly for functions. When I create a php anchor or a href tag it redirect me to 127.0.0.1:

<?php echo anchor('tasks/create', '<p>Create New Task</p>'); ?>
OR
<a href="<?php echo base_url('tasks/two_col_template'); ?>">Create New Task</a>
OR
<a href="<?= base_url('tasks/two_col_template'); ?>">Create New Task</a>

But when I remove echo before base_url() it works fine.

<a href="<?php base_url(); ?>/tasks/two_col_template"> create Task</a>

Can anyone tell me the reason why it is redirecting me to 127.0.0.1/Modules/Controller

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM