Skip to main content

Posts

Showing posts from May, 2017

Web Development

HaydarOrac

HaydarOrac

HaydarOrac

HaydarOrac

you can learn with this site toooo it's the best resource online ever www.lynda.com but it's not free ..................................
and you can find many lessons on youtube you can study with them just my advice is find the best one for you the one you can understand the lesson from it
now let's back to the networking study this is the best way to learn networks learning communities from CISCO you can check it with there website and today there is new version of gns3 will be up with this new version you can work with multi user you can check it on there website www.gns3.com  
Many times, while making web pages, we want to repeat certain part of pages in other pages. CakePHP has such facility by which one can extend view in another view and for this, we need not repeat the code again. The  extend()  method is used to extend views in  View  file. This method takes one argument, i.e., the name of the view file with path. Don’t use extension .ctp while providing the name of the View file. Example Make changes in the  config/routes.php  file as shown in the following program. config/routes.php <? php use Cake \Core\Plugin ; use Cake \Routing\RouteBuilder ; use Cake \Routing\Router ; Router :: defaultRouteClass ( 'DashedRoute' ); Router :: scope ( '/' , function ( RouteBuilder $routes ) { $routes -> connect ( 'extend' ,[ 'controller' => 'Extends' , 'action' => 'index' ]); $routes -> fallbacks ( 'DashedRoute' ); }); Plugin :: rout...
The letter “V” in the MVC is for Views. Views are responsible for sending output to user based on request.  View Classes  is a powerful way to speed up the development process. View Templates The View Templates file of CakePHP has default extension . ctp  (CakePHP Template). These templates get data from controller and then render the output so that it can be displayed properly to the user. We can use variables, various control structures in template. Template files are stored in  src/Template/ , in a directory named after the controller that uses the files, and named after the action it corresponds to. For example, the  View  file for the Products controller’s  “view()”  action, would normally be found in src/Template/Products/view.ctp. In short, the name of the controller (ProductsController) is same as the name of the folder (Products) but without the word Controller and name of action/method (view()) of the controller (ProductsControl...
The controller as the name indicates controls the application. It acts like a bridge between models and views. Controllers handle request data, makes sure that correct models are called and right response or view is rendered. Methods in the controllers’ class are called  actions . Each controller follows naming conventions. The Controller class names are in plural form, Camel Cased, and end in Controller −  PostsController . AppController The  AppConttroller  class is the parent class of all applications’ controllers. This class extends the  Controller  class of CakePHP. AppController is defined at  src/Controller/AppController.php . The file contains the following code. <? php namespace App \Controller ; use Cake \Controller\Controller ; use Cake \Event\Event ; class AppController extends Controller { public function initialize (){ parent :: initialize (); $this -> loadComponent ( 'Request...
Redirect routing is useful when we want to inform client applications that this URL has been moved. The URL can be redirected using the following function. static Cake\Routing\Router::redirect($route, $url, $options =[]) There are three arguments to the above function − A string describing the template of the route. A URL to redirect to. An array matching the named elements in the route to regular expressions which that element should match. Example Make Changes in the  config/routes.php  file as shown below. Here, we have used controllers that were created previously. config/routes.php <? php use Cake \Core\Plugin ; use Cake \Routing\RouteBuilder ; use Cake \Routing\Router ; Router :: defaultRouteClass ( 'DashedRoute' ); Router :: scope ( '/' , function ( RouteBuilder $routes ) { $routes -> connect ( '/generate2' , [ 'controller' => 'Tests' , 'action' => 'index...
This is a cool feature of CakePHP. Using the generated URLs, we can easily change the structure of URL in the application without modifying the whole code. url( string|array|null $url null , boolean $full false ) The above function will take two arguments − The first argument is an array specifying any of the following −  'controller', 'action', 'plugin' . Additionally, you can provide routed elements or query string parameters. If string, it can be given the name of any valid url string. If true, the full base URL will be prepended to the result. Default is false. Example Make Changes in the  config/routes.php  file as shown in the following program. config/routes.php <? php use Cake \Core\Plugin ; use Cake \Routing\RouteBuilder ; use Cake \Routing\Router ; Router :: defaultRouteClass ( 'DashedRoute' ); Router :: scope ( '/' , function ( RouteBuilder $routes ){ $routes -> connect ( '/...