Welcome Guest, Not a member yet? Register   Sign In
Passing URI Segments to methods
#1

Hi! I have a view with this link: 

Code:
<a href="<?php echo base_url('en/article/'.$slug);?>"> Article Title </a>

.tb_button {padding:1px;cursor:pointer;border-right: 1px solid #8b8b8b;border-left: 1px solid #FFF;border-bottom: 1px solid #fff;}.tb_button.hover {borer:2px outset #def; background-color: #f8f8f8 !important;}.ws_toolbar {z-index:100000} .ws_toolbar .ws_tb_btn {cursor:pointer;border:1px solid #555;padding:3px} .tb_highlight{background-color:yellow} .tb_hide {visibility:hidden} .ws_toolbar img {padding:2px;margin:0px}
I would like pass the $slug variable to my method named article but i have an error: Too few arguments to function App\Controllers\En\Main::article(), 0 passed in...

My method:

PHP Code:
public function article($slug)
{
$data['article'] = $this->articlesModel->where('slug'$slug)->first();

// OTHER... 
I have read here: https://codeigniter.com/userguide4/incom...ur-methods 

Someone can help me please? Thanks.
Reply


Messages In This Thread
Passing URI Segments to methods - by eleumas - 02-23-2021, 11:12 AM
RE: Passing URI Segments to methods - by InsiteFX - 02-23-2021, 12:12 PM
RE: Passing URI Segments to methods - by eleumas - 02-24-2021, 04:26 AM
RE: Passing URI Segments to methods - by Chroma - 02-25-2021, 08:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB