Saltar al contenido

KOHANA

Kohana Uno a Muchos 1:n

FILE (/application/classes/model/company/company.php) class Model_Company_Company extends ORM { protected $_table_name = ‘company’; protected $_belongs_to = array( ‘rsCategory’ => array( ‘model’ => ‘company_category’, ‘foreign_key’ => ‘category_id’, )… Leer más »Kohana Uno a Muchos 1:n

Pagination Kohana

File ROUTE (/application/bootstrap.php) Route::set(‘list’, ‘list(/(/))’) ->defaults(array( ‘directory’ => ‘frontend’, ‘controller’ => ‘company’, ‘action’ => ‘list’, )); File CONTROLLER (/application/classes/controller/frontend/company.php) public function action_list(){ $slug = $this->request->param(‘slug’);… Leer más »Pagination Kohana

SQL Like Kohana

Realizar una búsqueda tipo LIKE con el ORM de Kohana Framework public function action_buscar(){ $q = $this->request->param(‘q’); $c = $this->request->param(‘c’); $ls_search = ORM::factory(«company_company») ->where(‘name’,’like’,»%$q%») ->find_all();… Leer más »SQL Like Kohana

Kohana : Configuration

/config/configuration.php return array( ‘padre1’ => array( ‘hijo1’ => ‘valor1’, ‘hijo2’ => ‘valor2’, ) ); Controller o View //Obtener el archivo configuration $config = Kohana::$config->load(‘configuration’); //Obtener… Leer más »Kohana : Configuration

Kohana – write data.txt

Crea el archivo data.txt en el root, al mismo nivel de application file_put_contents(‘data.txt’, $XML_SUBMIT_TRANSACTION, FILE_APPEND);