Php 无法使用控制器重定向到codeigniter页面上的特定位置
在CodeIgniter中,我想将下面给定的链接从另一个页面重定向到名为Php 无法使用控制器重定向到codeigniter页面上的特定位置,php,codeigniter,Php,Codeigniter,在CodeIgniter中,我想将下面给定的链接从另一个页面重定向到名为“profile.php”的页面视图,该页面视图由previewProfile()方法调用,其中“brdetails”是页面上锚定标记的名称。我想在重定向页面上滚动页面,其中提到了锚标签 viewname.php[下面是在模型中使用previewProfile()方法调用profile.php的给定代码] Profile.php 一切都使用路由..进入应用程序->配置->routes.php,在那里像这样使用 $rout
“profile.php”
的页面视图,该页面视图由previewProfile()
方法调用,其中“brdetails”
是页面上锚定标记的名称。我想在重定向页面上滚动页面,其中提到了锚标签
viewname.php[下面是在模型中使用previewProfile()方法调用profile.php的给定代码]
Profile.php
一切都使用路由..进入应用程序->配置->routes.php,在那里像这样使用
$route['View_Function'] = "controllerName/View_Function";//normal view
$route['SaveFunction'] = " controllerName/SaveFunction";
$route['UpdateFunction'] = " controllerName/UpdateFunction";
$route['Function_Listing'] = "controllerName/Function_Listing";
//load list only $route['Function_Listing/(:num)'] ="controllerName/Function_Listing/$1";
//pagination
$route['Edit_Function/(:num)'] = "controllerName/Edit_Function/$1";
$route['Delete_Function'] = "controllerName/Delete_Function";
然后在你看来
<a href="<?php print base_url();?>Edit_Function/prifle_id" >Preview</a>
试试这个
<a href="<?php echo base_url();?>Controller_Name/previewProfile#brdetails" >
Preview
</a>
您没有向下滚动到特定id的原因是,您没有在
中包含任何id=“brdetails”
在profile.php
中,将
更改为
希望这会有所帮助。做这个@Siddharthasesunuri谢谢你。。。。但它不起作用。
<a href="<?php print base_url();?>Edit_Function/prifle_id" >Preview</a>
<a href="<?php echo base_url();?>Controller_Name/previewProfile#brdetails" >
Preview
</a>