Installation and first controller

Installation and first controller Create a minimum of your vhost ServerName phpway DocumentRoot /var/www/phpway/public If vhost is installed succesfully framework will ask you to create and give writable permissins to log file. touch /var/www/phpway/public/../log/development.log chmod 777 /var/www/phpway/public/../log/development.log Now, edit config/routes.php file and add first route to your controlelr. On default action is index. In our [...]

Html Helper

Html Helper link_to() $this->link_to($name, array( $url_options = array(), $html = array() )) Example = $this->link_to(‘Link’, array(‘url’ => array(‘action’ => ‘my_action’, ‘controller’ => ‘my_controller’, ‘id’ => ’1′, ‘param’ => ‘param’), ‘html’ => array(‘class’ => ‘link_class’))) Html <a class=”link_class” href=”/my_controller/my_action/1&param=param”>Link</a> link_to_remote() $this->link_to_remote($name, array( $url_options = array(), $ajax_options = array(), $html = array() )) Example = $this->link_to_remote(‘Link’, array(‘url’ [...]


Usage for apps of multiple languages. $this->translate (“some text”); If you specify other languages confg/config.ini file this way: translations = pl phpway will create new file pl.php in config/dictionary/ directory config/dictionary/pl.php with new content. $text['some text']=’some text’; Here you can type text in polish language. $text['some text']=’jakis tekst’; To show your app with polish language [...]


Smtp configuration edit config/config.ini [ActionMailer] address = port = 25 domain = user_name = admin@example password = user_password ttl = false Code setting basic header $this->Mail->to(‘”USER NAME” ‘); $this->Mail->from(‘”USER NAME” ‘); $this->Mail->subject(“SUBJECT”); adding attachments $this>Mail->attachment(DIR_PUBLIC . ‘file.txt’); $this>Mail->attachment(DIR_PUBLIC . ‘another_file.txt’); setting body $body = $this->render_to_string(‘/notifier/registration’); $this->Mail->plain($body); or $this->Mail->html($body); or $this->Mail->body($body); send an email [...]