passing name instead of id |
Right before
PHP Code: $data["links"] = $this->pagination->create_links(); insert this: PHP Code: echo '<pre>'; (10-26-2019, 02:30 AM)Wouter60 Wrote: Right before Output for this : Array ( [full_tag_open] =>
[num_tag_open] => [*] [num_tag_close] => [cur_tag_open] => [*] [cur_tag_close] => (current) [next_tag_open] => [*] [next_tag_close] => [prev_tag_open] => [*] [prev_tag_close] => [first_tag_open] => [*] [first_tag_close] => [last_tag_open] => [*] [last_tag_close] => [base_url] => http://[::1]/ciprojects/showtime/movies/genre [total_rows] => Array ( ) [first_url] => http://[::1]/ciprojects/showtime/movies/genre [per_page] => 18 [uri_segment] => 3 [use_page_numbers] => 1 ) i have doubt on this line64 @ Movies_genre.php on passing parameter, $data['movies_fetched'] = $this->Model_movie_genre->movies_by_genre($genre_type, $config["per_page"], $offset); Note : All Gitlab files are updated regularly.
$config['total_rows'] should be a numeric value (0 or greater), not an array!
(10-26-2019, 08:48 AM)Wouter60 Wrote: $config['total_rows'] should be a numeric value (0 or greater), not an array! so, how could we pass this $config["total_rows"] = $this->Model_movie_genre->movies_by_genre($genre_type); actually i use the same script for movies page (2nd menu) it works fine, in this movies-genre i pass a parameter $genre_type which makes not working. If possible could you @Wouter60 have a look into all MVC files and shoot me which causes the trouble. Files @GitLab
Live Website @ http://cishowtime.22web.org
Pagination works fine on #Movies page @ http://cishowtime.22web.org/movies Resource files of #Movies page : Model file => Model_movie.php View file => view_movies.php Controller file => Movies.php Issue on #MoviesGenre page @ http://cishowtime.22web.org/movies/genre/Action Resource files of #MoviesGenre page : Model file => Model_movie_genre.php View file => view_movies_genre.php Controller file => Movies_genre.php MVC files of Movies(which works fine) & MoviesGenre(which has issue) @ https://gitlab.com/manigopal/ci-projects...r/Showtime
Pagination works fine on #Movies page @ http://cishowtime.22web.org/movies
i have added / passed parameter for genre in Movies_genre.php then its not working.,
Your controller has this line:
PHP Code: $config["total_rows"] = $this->Model_movie_genre->movies_by_genre($genre_type); The model function: PHP Code: public function movies_by_genre($genre_type) Create a new function in the model: PHP Code: public function movie_count($genre_type) In the controller: PHP Code: $config["total_rows"] = $this->Model_movie_genre->movie_count($genre_type);
10-27-2019, 07:16 AM
(This post was last modified: 10-27-2019, 07:20 AM by manigopal. Edit Reason: elaborating )
Okay,
what about this line is this right ? $data['movies_fetched'] = $this->Model_movie_genre->movie_count($config["per_page"], $offset); @Movies_genre.php ~ controller file, since we pass a parameter called $genre_type in movie_count function at Model page. Quote:what about this line is this right ?Something is telling me that this line can't be correct, otherwise you wouldn't be asking, would you? It appears to me that you don't understand the concept of php functions. Imagine a function as a kitchen scale with a basket on it, and that you want to weigh potatoes. You put some potatoes into the basket; the scale will return (tell you) the weight in ounces. If you pour milk into the basket, along with 6 bananas, you'll end up with a mess. The milk won't stay in the basket. And the scale won't return the weight of potatoes, because you didn't put any potatoes in it. The values that you pass to a function should match the parameters the function expects to be passed (in number and in value type). The return value of the function should match the (type of) value that's being expected by the line that calls the function. Don't mess around with that. |
Welcome Guest, Not a member yet? Register Sign In |