Skip to main content

Home/ Larvata/ Group items tagged mvc

Rss Feed Group items tagged

crazylion lee

mapmeld/fortran-machine: Testing a Fortran MVC web platform - 0 views

  •  
    "Testing a Fortran MVC web platform https://fortran.io"
crazylion lee

gernest/utron - 0 views

  •  
    "utron is a lightweight MVC framework. It is based on the principles of simplicity, relevance and elegance."
張 旭

React 入门实例教程 - 阮一峰的网络日志 - 0 views

  • React 起源于 Facebook 的内部项目,因为该公司对市场上所有 JavaScript MVC 框架,都不满意,就决定自己写一套,用来架设 Instagram 的网站。
  • 项目本身也越滚越大,从最早的UI引擎变成了一整套前后端通吃的 Web App 解决方案
  • React Native 项目,目标更是宏伟,希望用写 Web App 的方式去写 Native App。
  • ...9 more annotations...
  • 凡是使用 JSX 的地方,都要加上 type="text/babel"
  • Browser.js 的作用是将 JSX 语法转为 JavaScript 语法,这一步很消耗时间,实际上线的时候,应该将它放到服务器完成。
  • HTML 语言直接写在 JavaScript 语言之中,不加任何引号,这就是 JSX 的语法,它允许 HTML 与 JavaScript 的混写
  • JSX 的基本语法规则:遇到 HTML 标签(以 < 开头),就用 HTML 规则解析;遇到代码块(以 { 开头),就用 JavaScript 规则解析。
  • JSX 允许直接在模板插入 JavaScript 变量。如果这个变量是一个数组,则会展开这个数组的所有成员
  • 所有组件类都必须有自己的 render 方法,用于输出组件
  • 组件类的第一个字母必须大写,否则会报错
  • 组件类只能包含一个顶层标签
  • 添加组件属性,有一个地方需要注意,就是 class 属性需要写成 className ,for 属性需要写成 htmlFor ,这是因为 class 和 for 是 JavaScript 的保留字。
張 旭

php - CakePHP: No such file or directory (trying to connect via unix:///var/mysql/mysql... - 0 views

  •  
    'port' => '/path/to/mysql.sock'
  •  
    'port' => '/private/tmp/mysql.sock'
張 旭

Blog Tutorial - Adding a layer - CakePHP Cookbook v2.x documentation - 1 views

  • Cake views are just presentation-flavored fragments that fit inside an application’s layout. For most applications they’re HTML mixed with PHP, but they may end up as XML, CSV, or even binary data.
  • Layouts are presentation code that is wrapped around a view, and can be defined and switched between
  • if the HTTP method of the request was POST, try to save the data using the Post model.
  • ...6 more annotations...
  • You can also specify URLs relative to the base of the application in the form of /controller/action/param1/param2.
  • Every CakePHP request includes a CakeRequest object which is accessible using $this->request.
  • When a user uses a form to POST data to your application, that information is available in $this->request->data.
  • The $this->Form->input() method is used to create form elements of the same name.
  • postLink() will create a link that uses Javascript to do a POST request deleting our post.
  • Allowing content to be deleted using GET requests is dangerous
張 旭

How do I change the time zone in CakePHP? - Stack Overflow - 0 views

  •  
    date_default_timezone_set('Asia/Taipei');
張 旭

Blog Tutorial - CakePHP Cookbook v2.x documentation - 0 views

  • need to have PDO, and pdo_mysql enabled in your php.ini.
  • will run into mod_rewrite issues
張 旭

rails/activeresource - 0 views

    • 張 旭
       
      所以執行 Person.find 時,會發送一個 GET 到 api.people.com:3000
    • 張 旭
       
      所以執行 Person.find 時,會發送一個 GET 到 api.people.com:3000
  • Active Resource is built on a standard JSON or XML format for requesting and submitting resources over HTTP
  • REST uses HTTP, but unlike “typical” web applications, it makes use of all the verbs available in the HTTP specification
  • ...2 more annotations...
  • When a request is made to a remote resource, a REST JSON request is generated, transmitted, and the result received and serialized into a usable Ruby object.
  • Relationships between resources can be declared using the standard association syntax that should be familiar to anyone who uses activerecord
張 旭

Embracing REST with mind, body and soul « Plataformatec Blog - 0 views

  • gain with respond_with introduction is more obvious if you compare index, new and show actions
    • 張 旭
       
      看起來 respond_with 會根據 request 型態自動回覆對應型態的 response
  • you can define supported formats at the class level and tell in the instance the resource to be represented by those formats.
  • when a request comes, for example with format xml, it will first search for a template at users/index.xml. If the template is not available, it tries to render the resource given (in this case, @users) by calling :to_xml on it
  • ...6 more annotations...
  • how to render our resources depending on the format AND HTTP verb
  • By default, ActionController::Responder holds all formats behavior in a method called to_format.
  • Suddenly we realized that respond_with is useful just for GET requests
  • it renders the resource based on the HTTP verb and whether it has errors or not
  • Your controller code just have to send the resource using respond_with(@resource) and respond_with will call ActionController::Responder which will know what to do.
    • 張 旭
       
      簡單說,就是只要寫 respond_with 就好了,其它都不用管了。Responder 會幫你判斷 HTTP 的動作。
  • Anything that responds to :call can be a responder, so you can create your custom classes or even give procs, fibers and so on.
1 - 9 of 9
Showing 20 items per page