Created an extra action and page view

public function action_read() { $data = array(); $hom = ORM::factory('News')->where('name','=','url(вот здесь надо сравнить с той статьей по которой кликнули)')->find_all(); $data['materials'] = $hom; $this->template->content = View::factory('ubuntu_read',$data); } 

I compare by name , the link will not glow by id but by name, like this

site.com/ubuntu/name_name

in bootstrap registered router

 Route::set('ubuntu', 'ubuntu/<action>/<id>') ->defaults(array( 'controller' => 'ubuntu', 'action' => 'index', )); 

How can I print the full article? It is necessary to compare the name from the address bar with the database, or rather with the name field

    1 answer 1

    there are 2 options: - either in the database, specify a unique name for each article (just what you have in the address bar, - or add id so that it "shines" in the address bar. But then you have to rewrite the route a little.

    By the way, you can download the model like this:

     $hom = ORM::factory('News', array('name' => article_name);