• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
issue for rewrite link in multilang site

#1
Hi! I have this controller:
PHP Code:
public function article($slug)
  {
    $data['article'] = $this->articlesModel->where('slug'$slug)->first();
    $dataArticle $data['article'];
    $data['title'] = $dataArticle['meta_title'];
    $data['metaDescription'] = $dataArticle['meta_description'];

    return view('article'$data);
  

This link in categories view:
PHP Code:
<?php $slug $a['slug'];?>
<a href="<?php echo base_url('en/'.$slug);?>" target="_blank">
<?php echo $a['heading'];?>
</a> 

And this (wrong) route:
PHP Code:
$routes->add('(:any)/it/(:any)''It/Main::article/$1'); 

What is the solution for open the article page with link: mysite.com/en/article-slug and not have 404 or a link like mysite.com/en/article/article-slug?

Thanks for the support!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.